Skip to content
DebugAllocatorInit

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)
                                                                .track_freed_history = true}))
    #    else
    #        define DefaultAllocatorInit() DebugAllocatorInit()
    #    endif
    #else
    
    bool test_debug_normal_alloc_free(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_zero_byte_alloc(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_null_free_is_noop(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_catches_overflow(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_leak_count(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_report_leaks_emits_traces(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_alloc_trace_captured(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_freed_history_grows_on_free(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_remap_grows(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_remap_to_zero_frees(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_remap_from_null_allocates(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_debug_double_free_aborts(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
        // live map -> forwarded to underlying Heap, which LOG_FATALs as
        // foreign pointer.
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_canary_detects_non_first_byte(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_freed_alloc_trace_n_copied(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_freed_alloc_trace_bytes_copied(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_stats_deallocations_increment(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_stats_bytes_in_use_partial_free(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_clean_roundtrip_no_false_overflow(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_double_free_aborts(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad1_foreign_free_aborts(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_alloc_bumps_live_bytes(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_alloc_increments_allocations(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_alloc_accumulates_bytes_requested(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_alloc_bumps_stats_bytes_in_use(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_alloc_tracks_peak_value(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_peak_advances_on_first_alloc(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_peak_holds_historical_max(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad2_failed_alloc_counter(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // [1, MAX_TRACE]; a const 42 is out of range.
    bool test_ad2_trace_count_within_bounds(void) {
        DebugAllocator dbg  = DebugAllocatorInit(); // capture_traces, trace_depth=8
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // inside [0, N)).
    bool test_ad2_full_width_write_is_clean(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // allocate returns a usable, correctly sized, zeroed region when asked.
    bool test_ad2_zeroed_region_is_zero_and_sized(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // broken hash would surface here as a spurious FATAL or a leak).
    bool test_ad2_hash_tracks_many_allocations(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // point shape; the validate gate is exercised by the deadend below.
    bool test_ad2_resize_refuses_in_place(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // Canary write side: alloc N, write N+1 -> overflow detected (counter).
    bool test_ad2_overflow_one_past_detected(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // would silently return 0 instead of aborting.
    bool test_ad2_resize_validates_self(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_ad3_remap_grow_preserves_full_old_width(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // canary (overflows stays 0); the mutant corrupts it.
    bool test_ad3_remap_shrink_copy_is_min_not_max(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // aborts; deadend captures it.
    bool test_ad3_remap_unknown_ptr_aborts(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // summary line and no frame markers.
    bool test_ad3_report_leaks_includes_trace_frames(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // Deadend: real code aborts here.
    bool test_ad3_structural_runs_on_first_entry(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        // Corrupt the embedded heap magic before the first validating entry
        // point; the validated bit is still set, so structural runs.
    // on) by the mutant. Normal test: real returns true; the mutant aborts.
    bool test_ad3_structural_skipped_after_first_op(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // trigger structural validation; real code accepts, the mutant aborts.
    bool test_ad3_structural_accepts_pow2_alignment(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        // Valid power-of-two alignment; validated bit still set so the first
        // entry runs structural and exercises the pow2 check.
    // `bytes!=0`) LOG_FATALs. Normal test: real returns true.
    bool test_ad3_structural_allows_live_allocation(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // Deadend: real code aborts here.
    bool test_af_structural_checks_page_magic(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        // Corrupt the embedded page allocator's magic before the first
        // validating entry. The validated bit is still set, so structural
    
    bool test_blind_stats_bytes_in_use_underflow_clamps_zero(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_blind_report_leaks_emits_all_frames(void) {
        DebugAllocator dbg  = DebugAllocatorInit(); // capture_traces on, depth 8
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    
    bool test_blind_report_leaks_no_extra_frame(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
        WriteFmt("Testing print_help frees per-spec left-column Strs (414:9)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
        WriteFmt("Testing GraphDeinit frees the pending-edge-removals backing (no leak)\n");
    
        DebugAllocator dbg = DebugAllocatorInit();
    
        typedef Graph(int) IntGraph;
        // event -- so asserting zero overflows kills the mutant deterministically
        // instead of relying on a chance heap crash.
        DebugAllocator dbg = DebugAllocatorInit();
    
        MutElemVec vec = VecInitWithDeepCopy(mut_copy_init, mut_copy_deinit, &dbg);
        WriteFmt("Testing BitVecRotateRight frees its temp clone (1157:5)\n");
    
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
        WriteFmt("Testing int_pow_mod frees internal temporaries\n");
    
        DebugAllocator dbg = DebugAllocatorInit();
    
        Int base         = IntFrom(123456789u, &dbg.base);
    // --- leak-guard / scratch-leak helpers relocated from Io.Blind.c + Io.Leak.c ---
    #define DBG_BEGIN(dbg, out)                                                                                            \
        DebugAllocator dbg = DebugAllocatorInit();                                                                         \
        Str            out = StrInit(&dbg)
    // ===========================================================================
    static bool test_read_zstr_no_leak(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        char          *s   = NULL;
        Zstr           in  = "hello world";
    // dtor leak.
    static bool test_read_bitvec_hex(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        BitVec         bv  = BitVecInit(&dbg.base);
        Zstr           z   = "0x1";
    // 3145/3154 scratch leak, 3150:21 lt_to_le `bit_len < 3` (octal min width).
    static bool test_read_bitvec_octal(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        BitVec         bv  = BitVecInit(&dbg.base);
        Zstr           z   = "0o1";
    // 3178 scratch leak for the binary path.
    static bool test_read_bitvec_binary(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        BitVec         bv  = BitVecInit(&dbg.base);
        Zstr           z   = "10110";
    // scratch leak, value round-trip.
    static bool test_read_int_plain(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        Int            v   = IntInit(&dbg.base);
        Zstr           z   = "12345";
    // ===========================================================================
    static bool test_read_float_value(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        Float          f   = FloatInit(&dbg.base);
        Zstr           z   = "3.14159";
    // the sentinel and frees scratch.
    static bool test_read_float_reject_no_leak(void) {
        DebugAllocator dbg = DebugAllocatorInit();
        Float          f   = FloatInit(&dbg.base);
        (void)FloatTryFromStr(&f, "42");
    // live-allocation count returning to its pre-split baseline (Str.Mutants4).
    static bool test_str_deinit_releases_split_elements(void) {
        DebugAllocator dbg = DebugAllocatorInit();
    
        // Each piece is long enough to force its own heap buffer.
    static bool test_deinit_frees_buffer(void) {
        WriteFmt("Testing StrDeinit releases the backing allocation\n");
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    static bool test_map_deep_copy_deinit_on_remove(void) {
        typedef Map(Zstr, Zstr) ZstrMap;
        DebugAllocator dbg = DebugAllocatorInit();
        // Deep-copy callbacks for both key and value, plus a value comparator
        // so the pair-level removal API is usable. The map owns Zstr clones it
    // -----------------------------------------------------------------------------
    bool test_pdb_cache_missing_pdb_no_leak(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *base     = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // -----------------------------------------------------------------------------
    bool test_pdb_cache_guid_mismatch_no_leak(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *base     = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // -----------------------------------------------------------------------------
    bool test_pdb_cache_second_module_hits_cache(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        Allocator     *base  = ALLOCATOR_OF(&alloc);
    // -----------------------------------------------------------------------------
    bool test_pdb_cache_deinit_frees_all(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *base     = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // divergence. A DebugAllocator also pins leak-freedom on the open-failure path.
    bool test_pdb_cache_invalid_sidecar_pdb_rejected(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *a        = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // entry `++i` and `--i` both free exactly entry[0].)
    bool test_pdb_cache_deinit_frees_all_entries(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *base     = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // The (Zstr, len) overload must not leak its internal path copy.
    static bool test_addpath_zstr_len_no_leak(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        Allocator     *a     = ALLOCATOR_OF(&alloc);
    
    static bool test_deinit_no_leak(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *a        = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    
    static bool test_init_real_disk_no_leak(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        Allocator     *a        = ALLOCATOR_OF(&alloc);
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // per-entry StrDeinit (54/141) and MachoDeinit (140) cleanups.
    bool test_mc_main_symtab_no_leak(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // compare (42 ZstrCompare->42).
    bool test_mc_cache_hit_and_distinct(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // count returns to baseline after deinit.
    bool test_mc_dsym_symtab_no_leak(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // path must not leak: the post-deinit live count returns to baseline.
    bool test_mc_dsym_uuid_mismatch_no_leak(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // Also drives DwarfFunctionsDeinit (136) on deinit; verified leak-free.
    bool test_mc_dwarf_resolves_and_no_leak(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // pins the build's success/failure result to an observable.
    bool test_bl_dwarf_resolves_no_leak(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // re-opens the module -> live count rises.
    bool test_sr_cache_hit_same_module(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        SymbolResolver res;
        if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
    // re-open. A mutant breaking `ZstrCompare(...) == 0` misses and re-opens.
    bool test_sr_cache_zstrcompare_fallback(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        SymbolResolver res;
        if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
    // address -> wrong module_path and no second open.
    bool test_sr_cache_cross_module_distinct(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        SymbolResolver res;
        if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
    // loop must walk PAST entry[0]; nothing re-opens.
    bool test_sr_cache_other_module_rehit(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        SymbolResolver res;
        if (!SymbolResolverInit(&res, ALLOCATOR_OF(&alloc))) {
    // frees everything and the live count returns to the pre-Init baseline.
    bool test_sr_deinit_frees_everything(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // which the DebugAllocator live count catches.
    bool test_sr_deinit_two_modules_frees_all(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // DwarfCfiDeinit arm leaks it; the live count fails to return to baseline.
    bool test_sr_findfde_teardown_frees_cfi(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // return to baseline.
    bool test_sidecardwarf_teardown_frees_sidecar_functions(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // to baseline; dropping it leaks and the count stays high.
    bool test_sidecarsub_teardown_frees(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // stays high.
    bool test_sidecar_teardown_frees_sidecar(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // them. Dropping either Deinit arm leaks; the live count fails to return.
    bool test_dwarffallback_teardown_frees(void) {
        DebugAllocator alloc    = DebugAllocatorInit();
        size           baseline = DebugAllocatorLiveCount(&alloc);
    // Asserting NULL kills the mutant.
    static bool test_pe_blind_find_empty_name_returns_null(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        Allocator     *base  = ALLOCATOR_OF(&alloc);
    // ---------------------------------------------------------------------------
    static bool test_leak_record_target_freed(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // ---------------------------------------------------------------------------
    static bool test_leak_authority_list_freed(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // ---------------------------------------------------------------------------
    static bool test_leak_additional_list_freed(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // per-stream arrays / taken Buf leak.
    bool test_pd4_failed_open_frees_all(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // name-pool buffer leaks.
    bool test_pd4_deinit_frees_name_pool(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // ===========================================================================
    static bool test_multiblock_directory_no_overrun(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // ===========================================================================
    static bool test_many_sections_no_overrun(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // and wrongly match. Kills `i < VecLen` -> `i <= VecLen`.
    bool test_pm2_find_no_overrun_past_length(void) {
        DebugAllocator alloc = DebugAllocatorInit();
        ProcMaps       pm;
        MemSet(&pm, 0, sizeof(pm));
    // removed-Deinit mutation observably.
    bool test_pm2_deinit_releases_all(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // kills the removed-Deinit mutation on the read-failure arm.
    bool test_pm_load_from_file_read_fail_frees_raw(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // reclaim is the vec's own copies -- exactly what the L31/L32 callback frees.
    bool test_hl_headers_vec_deinit_releases_values(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // dropping its StrDeinit leaks it even though VecDeinit + MemSet still run.
    bool test_hl_request_deinit_releases_url(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // previous body. Pre-fill the body via one HtmlRespond, then call again.
    bool test_hl_respond_with_html_releases_old_body(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // body.
    bool test_hl_respond_with_file_releases_old_body(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // buffer has been taken/allocated.
    bool test_mh2_fail_path_frees_buffer(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // ---------------------------------------------------------------------------
    bool test_dw4_build_frees_cu_strings(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // ---------------------------------------------------------------------------
    bool test_dw4_deinit_releases_string_pool(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *base = ALLOCATOR_OF(&dbg);
    // config teardown and pushes LiveCount above 0.
    static bool test_kv_leak_value_strip_frees_old_buffer(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // heap buffer the live count must account for.
    static bool test_kv_leak_parse_frees_local_key(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // key-side buffer from masking the value-side leak.
    static bool test_kv_leak_parse_frees_local_value(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
    // teardown. A long lookup key keeps the temp off any inline fast path.
    static bool test_kv_leak_get_ptr_zstr_frees_lookup(void) {
        DebugAllocator dbg  = DebugAllocatorInit();
        Allocator     *adbg = ALLOCATOR_OF(&dbg);
Last updated on