This commit fixes the issue when trying to allocate memory
with the MALLOC_CAP_EXEC in RTC memory. Prior to the fix,
the heap allocator was returning an address in RTC DRAM.
To fix this issue:
- modified memory_layout.c of the concerned targets to fill the iram_address
field in the rtc entry of the soc_memory_region array properly.
- modified heap component related functions to return IRAM address when
an allocation in RTC memory with MALLOC_CAP_EXEC is requested.
Closes https://github.com/espressif/esp-idf/issues/14835
In esp32c2 and esp32c61 memory_layout.c files, the config used to allow
MALLOC_CAP_EXEC was CONFIG_ESP_SYSTEM_MEMPROT_FEATURE when
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT should be used.
Closes https://github.com/espressif/esp-idf/issues/14836
For a given group of heaps sharing the same capabilities, it is
best to use smaller heaps first when performing "small" allocations
to keep the bigger heaps untouched. This prevents the scenario where
a series of small allocations would crowd the bigger heaps making
any bigger allocation fail for lack of space.
Closes https://github.com/espressif/esp-idf/issues/13588
- Place the section on alloc failed hook at a better place
- Add reference to the different poisoning configs at the beginning
of the heap corruption detectino section
- Update the information concerning heap tracing
- Update the heap tracing log examples
- Fix heap tracing standalone code:
- Update the logging format in heap_trace_dump_base
- Add freed field in trace stucture to keep this info even
when no call stack is available
Create a specific group "psram" to only run meaningful
tests on the sdkconfig.ci.psram and sdkconfig.ci.psram_all_ext
configuration.
Add test testing that external memory is prioritized when using
MALLOC_CAP_DEFAULT.
The new TLSF architecture has changed. tlsf.h public API
header is now moved into an include folder. tlsf_common.h
is removed from the repo.
This commit updates the heap component and respective
esp_rom patches to take into account this new
architecture.
The implicit promise of heap_alloc_caps() and friends is that the memory it
returns is fit for the purpose as requested in the caps field. Before
this commit, that did not happen; e.g. DMA-capable memory wass returned
from a correct region, but not aligned/sized to something the DMA subsystem
can handle.
This commit adds an API to the esp_mm component that is then used by the
heap component to adjust allocation alignment, caps and size dependent on
the hardware requirement of the requested allocation caps.
This commit adds a feature to pause the heap tracing in the
sense that in this state, the heap tracing will no longer
record the new allocations but will continue to monitor
the free() in order to keep track of the status of the
allocations present in the list of records.
See https://github.com/espressif/esp-idf/issues/13803
don't check for heaps_array != NULL in the loop.
The check is done after the loop since it is allowed
for the allocation to fail until finding aa ssuitable
heap.
Add a test to make sure that the task handles returned in the
task tracking information are valid task handles.
To verify that, feed the task name returned by pcTaskGetName()
using the task handle under test to xTaskGetHandle() and make
sure the task handle returned matches the one under test.
Propagate `n * size` as the size of the failed allocation
instead of just `size` when heap_caps_calloc() fails since
`n * size` is the actual number of bytes that the heap
component tried to allocate.