DEBUG_ALLOCATOR_DEFAULTS
Description
All-checks-on DebugAllocatorConfig baseline. Use as the argument to DebugAllocatorInitWith (or the default carried by DebugAllocatorInit) when you want every diagnostic the allocator offers: trace capture, canary overflow detection, freed-history tracking. Page-backed UAF detection is left OFF because it makes freed regions unreclaimable; opt in explicitly via DebugAllocatorInitWith when you want it.
Success
Yields a DebugAllocatorConfig value with capture_traces, detect_overflow, track_freed_history all true, force_page_backing false, trace_depth = 8, canary_bytes = 16.
Failure
Macro cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
AllocDebug.c:198:
// When track_freed_history = false, freed Vec stays empty even
// after many frees -- and allocator is still functional.
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.track_freed_history = false;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
AllocDebug.c:274:
bool test_debug_page_backed_alloc_free(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.force_page_backing = true;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
Debug.h:540:
/// TAGS: Allocator, Debug, Init
///
#define DebugAllocatorInit() DebugAllocatorInitWith(DEBUG_ALLOCATOR_DEFAULTS)
#endif // MISRA_STD_ALLOCATOR_DEBUG_H
Last updated on