DebugRecord
Description
Live-allocation bookkeeping record. Stored in the embedded live map keyed by pointer.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Debug.h:83:
u32 alloc_trace_n;
StackFrame alloc_trace[DEBUG_ALLOCATOR_MAX_TRACE];
} DebugRecord;
typedef Map(void *, DebugRecord) DebugRecordMap;- In
Debug.h:85:
} DebugRecord;
typedef Map(void *, DebugRecord) DebugRecordMap;
///
- In
Debug.c:244:
debug_write_canary((u8 *)user_p + bytes, canary);
DebugRecord rec;
MemSet(&rec, 0, sizeof(rec));
rec.requested_size = bytes;- In
Debug.c:313:
return 0;
DebugRecord *live_rec = MapGetFirstPtr(&self->live, ptr);
if (!live_rec) {- In
Debug.c:434:
// the copy. If ptr is not in the live map, forward to deallocate
// which emits the double-free / foreign-ptr diagnostic and aborts.
DebugRecord *rec = MapGetFirstPtr(&self->live, ptr);
if (!rec) {
debug_allocator_deallocate(self, ptr); // aborts
- In
AllocDebug.c:155:
// to DebugAllocator with no public accessor; reach in to confirm the
// alloc-trace was captured.
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL) && (rec->alloc_trace_n > 0);- In
AllocDebug.c:374:
// intentional bypass: live map / freed Vec are internal, no accessor.
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
u32 live_n = ok ? rec->alloc_trace_n : 0;
ok = ok && (live_n > 0) && (live_n <= DEBUG_ALLOCATOR_MAX_TRACE);- In
AllocDebug.c:399:
bool ok = (p != NULL);
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
u32 n = ok ? rec->alloc_trace_n : 0;
StackFrame snapshot[DEBUG_ALLOCATOR_MAX_TRACE];- In
AllocDebug.c:786:
bool ok = (p != NULL);
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL);
ok = ok && (rec->alloc_trace_n > 0);- In
AllocDebug.c:809:
bool ok = (p != NULL);
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL);
ok = ok && (rec->alloc_trace_n > 0);- In
AllocDebug.c:835:
bool ok = (p != NULL);
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL);
ok = ok && (rec->alloc_trace_n > 0);- In
AllocDebug.c:918:
// must find each one; a broken hash would miss some).
for (u32 i = 0; i < N; i++) {
DebugRecord *rec = MapGetFirstPtr(&dbg.live, ps[i]);
ok = ok && (rec != NULL);
ok = ok && (rec->requested_size == (size)(8 + (i & 31))); // captured frame count; reach in to require >= 2 frames so "#1" must
// appear in a faithful render.
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL) && (rec->alloc_trace_n >= 2);
// intentional bypass: snapshot the live record's frame count.
DebugRecord *rec = MapGetFirstPtr(&dbg.live, p);
ok = ok && (rec != NULL) && (rec->alloc_trace_n >= 1);
u32 n = ok ? rec->alloc_trace_n : 0;
Last updated on