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
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
Insert.c:27:
// 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
Compare.c:19:
// detection (LiveCount / LiveBytes) is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
bool test_float_compare_small_small(void);- In
Math.c:19:
// detection (LiveCount / LiveBytes) is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
bool test_float_negate_abs(void);- In
Convert.c:19:
// detection (LiveCount / LiveBytes) is unchanged.
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
bool test_float_from_unsigned_integer(void); // 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};
} // keep the leak tests fast.
static DebugAllocatorConfig lean_dbg_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
} // 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};
} // keep the leak tests fast.
static DebugAllocatorConfig lean_dbg_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Math.c:10:
#include "../../Util/TestRunner.h"
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Math.c:11:
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Math.c:17:
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
bool test_int_shift_left_grows(void);- In
Convert.c:11:
#include "../../Util/TestRunner.h"
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Convert.c:12:
static DebugAllocatorConfig blind_cfg(void) {
return (DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false};
}- In
Convert.c:18:
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
bool test_int_from_unsigned_integer(void);- In
Write.c:4774:
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
#define LEAK_WRITE_PRELUDE() \- In
Read.c:2099:
#define LEAK_CFG \
((DebugAllocatorConfig) {.capture_traces = false, .detect_overflow = false, .track_freed_history = false})
- In
Dns.c:1846:
// 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
Dwarf.c:3090:
// 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
Parse.c:628:
// 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