heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on

Significantly speeds up heap initialization at startup when default "Light" heap
poisoning is enabled.

Tip via reddit user LinkeSeitentasche https://www.reddit.com/r/esp32/comments/fnj51a/a_guide_to_improving_esp32_boot_speed/
This commit is contained in:
Angus Gratton 2020-04-02 16:32:45 +11:00 committed by Angus Gratton
parent 6c9864ce86
commit 13ef9cf4bc

View File

@ -354,9 +354,11 @@ void *multi_heap_get_block_owner(multi_heap_block_handle_t block)
multi_heap_handle_t multi_heap_register(void *start, size_t size) multi_heap_handle_t multi_heap_register(void *start, size_t size)
{ {
#ifdef SLOW
if (start != NULL) { if (start != NULL) {
memset(start, FREE_FILL_PATTERN, size); memset(start, FREE_FILL_PATTERN, size);
} }
#endif
return multi_heap_register_impl(start, size); return multi_heap_register_impl(start, size);
} }