mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
[Heap Trace Standalone] fix terrible Leaks perf on large records by using doubly linked list
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "sys/queue.h"
|
||||
#include <stdint.h>
|
||||
#include <esp_err.h>
|
||||
|
||||
@@ -29,13 +30,16 @@ typedef enum {
|
||||
/**
|
||||
* @brief Trace record data type. Stores information about an allocated region of memory.
|
||||
*/
|
||||
typedef struct {
|
||||
struct heap_trace_record_struct_t {
|
||||
uint32_t ccount; ///< CCOUNT of the CPU when the allocation was made. LSB (bit value 1) is the CPU number (0 or 1).
|
||||
void *address; ///< Address which was allocated
|
||||
void *address; ///< Address which was allocated. If NULL, then this record is empty.
|
||||
size_t size; ///< Size of the allocation
|
||||
void *alloced_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which allocated the memory.
|
||||
void *freed_by[CONFIG_HEAP_TRACING_STACK_DEPTH]; ///< Call stack of the caller which freed the memory (all zero if not freed.)
|
||||
} heap_trace_record_t;
|
||||
TAILQ_ENTRY(heap_trace_record_struct_t) tailq; ///< Linked list: prev & next records
|
||||
};
|
||||
|
||||
typedef struct heap_trace_record_struct_t heap_trace_record_t;
|
||||
|
||||
/**
|
||||
* @brief Stores information about the result of a heap trace.
|
||||
|
Reference in New Issue
Block a user