DebugRecord
Description
Per-allocation bookkeeping record. Stored in the embedded live / freed maps. Strings (none today) and stack frames live inline in the struct.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Debug.c:134:
debug_write_canary((u8 *)user_p + bytes, canary);
DebugRecord rec;
MemSet(&rec, 0, sizeof(rec));
rec.requested_size = bytes;- In
Debug.c:165:
}
static void debug_record_free_trace(DebugAllocator *dbg, DebugRecord *rec) {
if (dbg->config.capture_traces && dbg->config.trace_depth > 0) {
u32 depth = dbg->config.trace_depth;- In
Debug.c:180:
return;
DebugRecord *live_rec = MapGetFirstPtr(&dbg->live, ptr);
if (!live_rec) {
if (dbg->config.retain_metadata && dbg->freed_map_initialized) {- In
Debug.c:183:
if (!live_rec) {
if (dbg->config.retain_metadata && dbg->freed_map_initialized) {
DebugRecord *freed_rec = MapGetFirstPtr(&dbg->freed, ptr);
if (freed_rec) {
dbg->double_frees += 1;- In
Debug.c:227:
}
DebugRecord record = *live_rec;
debug_record_free_trace(dbg, &record);
dbg->bytes_in_use -= (u64)live_rec->requested_size;- In
Debug.h:72:
StackFrame alloc_trace[DEBUG_ALLOCATOR_MAX_TRACE];
StackFrame free_trace[DEBUG_ALLOCATOR_MAX_TRACE];
} DebugRecord;
typedef Map(void *, DebugRecord) DebugRecordMap;- In
Debug.h:74:
} DebugRecord;
typedef Map(void *, DebugRecord) DebugRecordMap;
///
Last updated on