feat(heap): update hash map to use singly linked list

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
This commit is contained in:
Guillaume Souchere
2023-10-12 12:24:15 +02:00
parent ed9f9021cc
commit 07165308f6
4 changed files with 61 additions and 24 deletions

View File

@@ -39,7 +39,7 @@ typedef struct heap_trace_record_t {
#if CONFIG_HEAP_TRACING_STANDALONE
TAILQ_ENTRY(heap_trace_record_t) tailq_list; ///< Linked list: prev & next records
#if CONFIG_HEAP_TRACE_HASH_MAP
TAILQ_ENTRY(heap_trace_record_t) tailq_hashmap; ///< Linked list: prev & next in hashmap entry list
SLIST_ENTRY(heap_trace_record_t) slist_hashmap; ///< Linked list: next in hashmap entry list
#endif // CONFIG_HEAP_TRACE_HASH_MAP
#endif // CONFIG_HEAP_TRACING_STANDALONE
} heap_trace_record_t;