OVMS3-idf/components/heap
Angus Gratton b0c5665f15 heap: Fix race condition causing malloc() to fail under some conditions
During a call to multi_heap_malloc(), if both these conditions were true:
- That heap only has one block large enough for the allocation
  (this is always the case if the heap is unfragmented).
- Another allocation is simultaneously occurring in the same heap.

... multi_heap_malloc() could incorrectly return NULL.

This caused IDF heap_caps_malloc() and malloc() to also fail, particularly
often if only one or two heaps had space for the allocation (otherwise
heap_caps_malloc() fails over to the next heap).
2017-10-19 16:05:00 +08:00
..
include Allocate some memories in SPIRAM first. 2017-10-13 10:11:24 +08:00
test Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
test_multi_heap_host multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +10:00
component.mk Heap tracing support 2017-09-07 16:32:05 +10:00
heap_caps.c Allocate some memories in SPIRAM first. 2017-10-13 10:11:24 +08:00
heap_caps_init.c Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
heap_private.h Add option to allocate external RAM using heap_alloc_caps 2017-09-14 10:47:44 +08:00
heap_trace.c Add option to allocate external RAM using heap_alloc_caps 2017-09-14 10:47:44 +08:00
Kconfig doc: Add docs for heap trace & poisoning 2017-09-07 16:32:05 +10:00
multi_heap.c heap: Fix race condition causing malloc() to fail under some conditions 2017-10-19 16:05:00 +08:00
multi_heap_config.h multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +10:00
multi_heap_internal.h multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +10:00
multi_heap_platform.h multi_heap: Print the problem address when aborting due to heap corruption 2017-09-18 16:54:23 +10:00
multi_heap_poisoning.c multi_heap_poisoning: Use MULTI_HEAP_STDERR_PRINTF (ets_printf) to print heap errors 2017-09-18 16:54:28 +10:00