41 #ifndef LEGATO_MEMORY_H 42 #define LEGATO_MEMORY_H 46 #if LE_MEMORY_MANAGER_ENABLE == 1 48 #define LE_FIXED_HEAP_COUNT 7 53 typedef struct leVariableHeapUsageReport
58 } leVariableHeapUsageReport;
76 typedef struct leFixedHeapUsageReport
80 size_t currentCapacity;
82 } leFixedHeapUsageReport;
87 typedef struct leMemoryStatusReport
89 leVariableHeapUsageReport variableHeapReport;
90 leFixedHeapUsageReport fixedHeapReport[LE_FIXED_HEAP_COUNT - 1];
91 } leMemoryStatusReport;
104 #if LE_USE_DEBUG_ALLOCATOR == 1 105 #define LE_MALLOC(size) leMalloc(size, __LINE__, __FUNCTION__, __FILE__) 106 #define LE_REALLOC(ptr, size) leRealloc(ptr, size, __LINE__, __FUNCTION__, __FILE__) 108 #define LE_MALLOC(size) leMalloc(size) 109 #define LE_REALLOC(ptr, size) leRealloc(ptr, size) 112 #define LE_FREE(ptr) leFree(ptr) 114 #if LE_USE_DEBUG_ALLOCATOR == 1 124 void* leMalloc(
size_t size,
142 void* leRealloc(
void* ptr,
157 void leFree(
void* ptr);
168 void* leMalloc(
size_t size);
180 void* leRealloc(
void* ptr,
193 void leFree(
void* ptr);
205 void leMemoryGetUsageReport(leMemoryStatusReport* rpt);
208 void leMemoryDumpAllocations(
void);
220 leResult leMemoryValidateHeaps(
void);
226 #define LE_MALLOC(size) malloc(size) 227 #define LE_REALLOC(ptr, size) realloc(ptr, size) 228 #define LE_FREE(ptr) free(ptr) 229 #endif // LE_MEMORY_MANAGER_ENABLE Common macros and definitions used by Legato.
leResult
This enum represents function call results.
Definition: legato_common.h:123