The integrity_walker now calls the integrity check hook to control
free AND used blocks of memory in the TLSF pool. This integrity walker
function is called from tlsf_check_pool.
This commit creates a patch of integrity_walker function to update the
outdated implementation in the ROM.
This changes `memalign` (and `posix_memalign`) so that it uses an
allocation method with the same selection criteria (checking
`malloc_alwaysinternal_limit` and picking one of:
- always MALLOC_CAP_INTERNAL
- MALLOC_CAP_INTERNAL first with fallback
- MALLOC_CAP_SPIRAM first with fallback
`malloc_alwaysinternal_limit` is in turn set by the options
`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` and
`CONFIG_SPRIAM_USE_CAPS_ALLOC`.
This notably affects folks using esp-rs to build rust code for the
esp-idf, as all allocations from rust use `memalign`.
Merges https://github.com/espressif/esp-idf/pull/12375
Previously, the hash map was a doubly linked list but was never
using the characteristics of it.
This commit switches the hash map to a singly linked list instead
This commit also fixes memory leak in heap trace tests by setting
hashmap size to 10 for the tests (instead of the default value of 250)
See https://github.com/espressif/esp-idf/issues/11173
In order to enable CONFIG_HEAP_TASK_TRACKING, some kind
of poisoning had to be enabled (!HEAP_POISONING_DISABLED).
However since those functionalities don't seem to be related
in any way, this commit decouple them by removing
MULTI_HEAP_BLOCK_OWNER from poison_head_t in multi_heap_poisoning.c
and handling the block ownership in heap_caps.c instead.
Note that handling task tracking in multi_heap.c would necessitate
updating the ROM implementation of multi_heap.c as well. For this
reason, the task tracking feature has to be handled in heap_caps.c.
This commit updates the tlsf submodule to include the modification made in the component
aiming to perform integrity check on all blocks (not only the free ones).
Added test to test the fix in test_apps/heap_tests.
Fixes https://github.com/espressif/esp-idf/issues/12231
1. move startup_stack attr from soc_memory_type_desc_t to soc_memory_region_t and
remove unused aliased_iram field
2. all of the last level of RAM is retention dma accessible on esp32c3
3. remove esp32c2 and later chips retention dma accessible memory caps
4. allow allocate memory from RTC_RAM with MALLOC_CAP_EXEC cap
esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around
Closes IDFGH-7930
See merge request espressif/esp-idf!23030
The commit fixes the case:
If variables in RTC RAM have been moved around by the linker,
they will be filled with garbage data. Any reset other than OTA would work fine
because the variables would still be initialized from the initial bootup.
So now system time will be valid even after OTA.
Closes https://github.com/espressif/esp-idf/issues/9448
- Remove the size limit for the hash_map array from the CONFIG_HEAP_TRACE_HASH_MAP_SIZE
- Add test case for heap tracing using hashmap
- Update heap_debug.rst to document the newly added configurations in the heap component
Closes https://github.com/espressif/esp-idf/issues/11172
Add test configuration to run all tests with heap component in the flash.
Add reference to this new configuration in performance section of the documentation.
- 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