DebugAllocatorConfig
Description
Runtime configuration. Use DEBUG_ALLOCATOR_DEFAULTS for a sensible all-checks-on baseline.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Default.h:74:
# if FEATURE_DEFAULT_ALLOC_DEBUG_PAGE_BACKED
# define DefaultAllocatorInit() \
DebugAllocatorInitWith(((DebugAllocatorConfig) {.capture_traces = true, \
.detect_overflow = true, \
.force_page_backing = true, \- In
Debug.h:131:
///
bool track_freed_history;
} DebugAllocatorConfig;
///
- In
Debug.h:151:
///
#define DEBUG_ALLOCATOR_DEFAULTS \
((DebugAllocatorConfig) {.capture_traces = true, \
.detect_overflow = true, \
.force_page_backing = false, \- In
Debug.h:168:
HeapAllocator meta;
PageAllocator page;
DebugAllocatorConfig config;
DebugRecordMap live;
DebugFreedVec freed;- In
Float.Leak.c:31:
// detection (LiveCount / LiveBytes) is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
// =============================================================================
static DebugAllocator blind_debug_alloc(void) {
DebugAllocatorConfig cfg = {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
return DebugAllocatorInitWith(cfg);
}- In
Graph.Blind.c:19:
// capture / overflow / freed-history bookkeeping, just live-count tracking.
static DebugAllocator make_lean_debug_allocator(void) {
DebugAllocatorConfig cfg = {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
return DebugAllocatorInitWith(cfg);
}- 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
AllocDebug.c:428:
bool test_ad1_freed_free_trace_n_zero_when_no_capture(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.capture_traces = false;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
AllocDebug.c:454:
bool test_ad1_freed_free_trace_n_capped_to_depth(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 2;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
AllocDebug.c:479:
bool test_ad1_freed_free_trace_n_clamped_to_max(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 20;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
AllocDebug.c:801:
// lifts the working depth to 16 (clamp) captures up to 16.
bool test_ad2_trace_depth_respected(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 4; // below MAX_TRACE
DebugAllocator dbg = DebugAllocatorInitWith(cfg);- In
AllocDebug.c:827:
// and record > 16 frames.
bool test_ad2_trace_depth_clamped_to_max(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 32; // above MAX_TRACE -> must clamp to 16
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
bool test_af_free_trace_depth_clamped(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.capture_traces = true;
cfg.trace_depth = 32; // above DEBUG_ALLOCATOR_MAX_TRACE (16)
- In
Dns.Blind.c:11:
// capture, no overflow canaries, no freed history -- just the live count.
static DebugAllocator make_lean_dbg(void) {
return DebugAllocatorInitWith(((DebugAllocatorConfig) {
.capture_traces = false,
.detect_overflow = false,- In
Int.Leak.c:27:
// LiveBytes are still tracked, so leak detection is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
// ---------------------------------------------------------------------------
- In
BitVec.Mut.c:14:
// Lean DebugAllocator config -- leak detection only, no trace capture, to
// keep the leak tests fast.
static DebugAllocatorConfig lean_dbg_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
BitVec.Mut.c:15:
// keep the leak tests fast.
static DebugAllocatorConfig lean_dbg_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Int.Blind.c:53:
#include "../Util/TestRunner.h"
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Int.Blind.c:54:
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Io.Leak.c:42:
// detection (LiveCount / LiveBytes) is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
// ---------------------------------------------------------------------------
- In
Dwarf.Mut.c:197:
// Lean leak-checking DebugAllocator config (no traces / overflow / history).
static DebugAllocator leak_alloc(void) {
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.capture_traces = false;
cfg.detect_overflow = false;- In
Blind.c:13:
// history. We only need the live-allocation round-trip count.
static DebugAllocator kv_lean_debug_allocator(void) {
DebugAllocatorConfig cfg = {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
return DebugAllocatorInitWith(cfg);
}
Last updated on