DebugAllocatorInit
Description
Construct a DebugAllocator with DEBUG_ALLOCATOR_DEFAULTS (all diagnostics on except page-backed UAF detection). The most common entry point for callers that just want leak + canary + trace tracking layered on top of HeapAllocator.
Success
Returns a fully-initialised DebugAllocator value with the defaults baseline; same post-init state as DebugAllocatorInitWith(DEBUG_ALLOCATOR_DEFAULTS).
Failure
Cannot fail at macro-expansion time.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
AllocDebug.c:30:
bool test_debug_normal_alloc_free(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:54:
bool test_debug_zero_byte_alloc(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:65:
bool test_debug_null_free_is_noop(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:82:
bool test_debug_catches_overflow(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:98:
bool test_debug_leak_count(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:112:
bool test_debug_report_leaks_emits_traces(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:146:
bool test_debug_alloc_trace_captured(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:168:
bool test_debug_freed_history_grows_on_free(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:223:
bool test_debug_remap_grows(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:245:
bool test_debug_remap_to_zero_frees(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:258:
bool test_debug_remap_from_null_allocates(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:295:
bool test_debug_double_free_aborts(void) {
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:308:
// live map -> forwarded to underlying Heap, which LOG_FATALs as
// foreign pointer.
DebugAllocator dbg = DebugAllocatorInit();
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Default.h:81:
.track_freed_history = true}))
# else
# define DefaultAllocatorInit() DebugAllocatorInit()
# endif
#else
Last updated on