- and place all added functions and vairables related to the hashmap in RAM
when the config is enabled only.
- add number of hash map entry as a Kconfig value and remove the hash map init function.
This prevents the user from allocating the hash map in flash and pass the pointer to the
init function (as the heap trace manipulate the hash map from functions placed in IRAM).
- add max linear value to the KConfig to make it configurable by the users.
- protect access to static variable "tracing"
- remove unecessary field in heap_trace_hashmap_entry_t
- Fix "test get allocated size"
- Add tests for the free / alloc hooks
- Call alloc function hook on malloc/realloc/calloc base functions
- Add caps parameter to the allocation hook function
After heap_idf.c has been added (where the FreeRTOS heap is a subset of the
ESP-IDF heap), xPortGetFreeHeapSize() was updated to only returns the free
size of the FreeRTOS heap and not the entire ESP-IDF heap.
This commit replaces calls of xPortGetFreeHeapSize() with
esp_get_free_heap_size() in places outside of FreeRTOS.
- Call TAILQ_INSERT_TAIL in linked_list_setup to add unused records from the tail of the list
- Fix test "heap trace leak check" to expect that after a free, the record is zeroed instead of checking that
the whole list of records is moved by one index in the array.
- Use esp_rom_printf() under lock instead of printf() since it does not rely on interrupts.
When light (or comprehensive) poisoning is enabled, the size requested by the user for allocation
is extended by a few bytes to store the canary header and footer. heap_caps_get_allocated_size() should
return the original size asked by the user (without the additional canary bytes).
test_malloc.c extended with a new test assuring that heap_caps_get_allocated_size() returns the proper size
regardless of the degree of poisoning.
If memory protection is enabled on esp32c3 and esp32s3, we don't want to the heap component to see
the startup stack memory as D/IRAM but as DRAM only. Introduce a new type to make this possible in
the same fashion the regular D/IRAM regions are handled.
Check that when trying to allocate in IRAM with the system memory protection enabled,
null pointer is returned, or that an address in IRAM is returned if the memory protection
is disabled.
Since DRAM and IRAM are superposed on esp32c6 it is not necessary to convert a freshly allocated
DRAM addr to its IRAM equivalent when MALLOC_CAP_EXEC is passed to heap_caps_malloc(). Instead,
proceed with a default allocation since the address returned by multi_heap_malloc() already belongs
to the IRAM region.
Applies for esp32c6 and every boards with superposed DRAM and IRAM addresses.
Added statistics and wear simulation functions to support migration of
remaining storage related host tests from fixture to linux implementation
of esp_partition.
when CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT is not set, the PMP rule for esp32c2 shoud allow write access.
Fix esp_cpu_configure_region_protection() in cpu.c accordingly.
Note: the checks for the tests marked as [test-dump] are done in the pytest function
test_heap_trace_dump() since they are relying on the content of the heap_trace_dump_caps()
output.
When stack check is enabled, certain functions (sometimes placed in RAM)
are being decorated with stack guards and a call to __stask_chk_fail() in
case ofr stack corruption. For this reason, __stack_chk_fail() must be
placed in RAM too.
Add stack check config in heap tests on all targets to find eventual flash to RAM
calls due to stack checks when running callgraph_check.py