From 100578a9e958c6ed5f8f6d64020a37ff24d060a2 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 2 Apr 2020 16:32:45 +1100 Subject: [PATCH] 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/ --- components/heap/multi_heap_poisoning.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/heap/multi_heap_poisoning.c b/components/heap/multi_heap_poisoning.c index ec620c079..9a9d739ad 100644 --- a/components/heap/multi_heap_poisoning.c +++ b/components/heap/multi_heap_poisoning.c @@ -355,9 +355,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) { +#ifdef SLOW if (start != NULL) { memset(start, FREE_FILL_PATTERN, size); } +#endif return multi_heap_register_impl(start, size); }