DebugAllocatorInitWith
Description
Construct a DebugAllocator with caller-supplied DebugAllocatorConfig. Use when you want to opt into force_page_backing or otherwise tune trace depth / canary width / freed-history retention away from the DEBUG_ALLOCATOR_DEFAULTS baseline. Captures the calling thread’s identifier at expansion so subsequent entry points can enforce the single-threaded contract.
_cfg is evaluated once.
Success
Returns a fully-initialised DebugAllocator value with the supplied config; the embedded heap / meta / page backing allocators are initialised but lazy (no OS calls yet); creator_tid is set to the calling thread.
Failure
Cannot fail at macro-expansion time.
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:540:
/// TAGS: Allocator, Debug, Init
///
#define DebugAllocatorInit() DebugAllocatorInitWith(DEBUG_ALLOCATOR_DEFAULTS)
#endif // MISRA_STD_ALLOCATOR_DEBUG_H
- In
AllocDebug.c:200:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.track_freed_history = false;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:276:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.force_page_backing = true;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:430:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.capture_traces = false;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:456:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 2;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:481:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 20;
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:803:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 4; // below MAX_TRACE
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
AllocDebug.c:829:
DebugAllocatorConfig cfg = DEBUG_ALLOCATOR_DEFAULTS;
cfg.trace_depth = 32; // above MAX_TRACE -> must clamp to 16
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg); cfg.capture_traces = true;
cfg.trace_depth = 32; // above DEBUG_ALLOCATOR_MAX_TRACE (16)
DebugAllocator dbg = DebugAllocatorInitWith(cfg);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Insert.c:28:
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:718:
bool test_compare_abs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);- In
Compare.c:740:
// float_compare_int_with_error [773:5]
bool test_compare_int_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("3.5", &dbg.base);
Int b = IntFrom(3, &dbg.base);- In
Compare.c:756:
// float_compare_u64_with_error [798:5]
bool test_compare_u64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("3.5", &dbg.base);- In
Compare.c:770:
// float_compare_i64_with_error [823:5]
bool test_compare_i64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("-3.5", &dbg.base);- In
Compare.c:784:
// float_compare_f32_with_error [848:5]
bool test_compare_f32_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("3.5", &dbg.base);- In
Compare.c:798:
// float_compare_f64_with_error [873:5]
bool test_compare_f64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("3.5", &dbg.base);- In
Math.c:992:
bool test_add_scaling_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base); // exp -1
- In
Math.c:1017:
bool test_add_replace_prepopulated_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("2.5", &dbg.base);- In
Math.c:1040:
bool test_add_cancel_to_zero_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("7.25", &dbg.base);- In
Math.c:1066:
bool test_div_success_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);- In
Math.c:1088:
bool test_div_zero_dividend_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFrom(0u, &dbg.base);- In
Math.c:1112:
bool test_mul_replace_prepopulated_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("2.5", &dbg.base);- In
Math.c:1136:
// float_add_int [970:5]
bool test_add_int_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1153:
// float_add_u64 [981:5]
bool test_add_u64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1168:
// float_add_i64 [992:5]
bool test_add_i64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1183:
// float_add_f32 [1003:5]
bool test_add_f32_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1198:
// float_add_f64 [1014:5]
bool test_add_f64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1213:
// float_sub (Float*Float): FloatDeinit(&rhs) negated clone [1030:5]
bool test_sub_float_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float b = FloatFromStr("1.25", &dbg.base);- In
Math.c:1230:
// float_sub_int [1041:5]
bool test_sub_int_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1247:
// float_sub_u64 [1052:5]
bool test_sub_u64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1262:
// float_sub_i64 [1063:5]
bool test_sub_i64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1277:
// float_sub_f32 [1074:5]
bool test_sub_f32_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1292:
// float_sub_f64 [1085:5]
bool test_sub_f64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("5.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1307:
// float_mul_int [1115:5]
bool test_mul_int_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1324:
// float_mul_u64 [1126:5]
bool test_mul_u64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1339:
// float_mul_i64 [1137:5]
bool test_mul_i64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1354:
// float_mul_f32 [1148:5]
bool test_mul_f32_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1369:
// float_mul_f64 [1159:5]
bool test_mul_f64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1.5", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1384:
// float_div_int [1216:5]
bool test_div_int_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1401:
// float_div_u64 [1228:5]
bool test_div_u64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1416:
// float_div_i64 [1240:5]
bool test_div_i64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1431:
// float_div_f32 [1252:5]
bool test_div_f32_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Math.c:1446:
// float_div_f64 [1264:5]
bool test_div_f64_rhs_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float a = FloatFromStr("1", &dbg.base);
Float r = FloatInit(&dbg.base);- In
Convert.c:666:
bool test_from_f64_negative_binexp_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFrom(0.5, &dbg.base); // binexp < 0 -> 5^|binexp| path
- In
Convert.c:677:
bool test_from_f32_negative_binexp_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFrom(1.5f, &dbg.base); // binexp < 0 -> 5^|binexp| path
- In
Convert.c:694:
bool test_normalize_trailing_zeros_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFrom(1000u, &dbg.base); // 1000 -> significand 1, exp 3
- In
Convert.c:711:
bool test_pow10_success_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("1e3", &dbg.base); // exponent 3 > 0 -> pow10
- In
Convert.c:733:
bool test_to_int_positive_exponent_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("12e4", &dbg.base); // significand 12, exp 4
- In
Convert.c:755:
bool test_to_int_negative_exponent_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("150e-1", &dbg.base); // 15.0, exact integer 15
- In
Convert.c:781:
bool test_to_int_negative_exponent_factor_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("1.5", &dbg.base); // significand 15, exponent -1
- In
Convert.c:803:
bool test_to_int_zero_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFrom(0u, &dbg.base);- In
Convert.c:824:
bool test_to_str_fractional_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("12.5", &dbg.base);- In
Convert.c:839:
bool test_to_str_integer_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("1200", &dbg.base); // exponent >= 0 arm
- In
Convert.c:861:
bool test_from_str_prepopulated_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float v = FloatFromStr("99999", &dbg.base); // pre-populated target
WriteFmt("Testing BitVecRotateLeft frees its temp clone (1131:5)\n");
DebugAllocator dbg = DebugAllocatorInitWith(lean_dbg_cfg());
Allocator *adbg = ALLOCATOR_OF(&dbg); WriteFmt("Testing bitvec_regex_match_zstr frees its rendered Str (1866:5)\n");
DebugAllocator dbg = DebugAllocatorInitWith(lean_dbg_cfg());
Allocator *adbg = ALLOCATOR_OF(&dbg); WriteFmt("Testing bitvec_regex_match_str frees its rendered Str (1883:5)\n");
DebugAllocator dbg = DebugAllocatorInitWith(lean_dbg_cfg());
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Math.c:3681:
bool test_mul_nonzero_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3700:
bool test_mul_zero_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3719:
bool test_add_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3738:
bool test_sub_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3757:
bool test_add_u64_in_place_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3776:
bool test_mul_u64_in_place_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3795:
bool test_sub_u64_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3812:
bool test_div_mod_ge_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3835:
bool test_div_mod_lt_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3857:
bool test_div_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3876:
bool test_div_exact_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3895:
bool test_div_scalar_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3920:
bool test_div_mod_scalar_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3948:
bool test_mod_int_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3967:
bool test_pow_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:3986:
bool test_gcd_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4006:
bool test_lcm_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4026:
bool test_root_rem_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4047:
bool test_root_rem_inexact_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4073:
bool test_root_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4090:
bool test_is_perfect_square_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4107:
bool test_is_perfect_power_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4124:
bool test_jacobi_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4151:
bool test_mod_add_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4172:
bool test_mod_sub_ge_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4194:
bool test_mod_sub_lt_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4216:
bool test_mod_sub_zero_diff_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4243:
bool test_mod_mul_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4264:
bool test_square_mod_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4283:
bool test_mod_div_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4304:
bool test_pow_u64_mod_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4325:
bool test_pow_mod_integer_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4347:
bool test_mod_inv_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4366:
bool test_mod_inv_negative_t_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4388:
bool test_mod_inv_no_solution_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4409:
bool test_mod_sqrt_p3mod4_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4430:
bool test_mod_sqrt_tonelli_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4453:
bool test_mod_sqrt_tonelli_larger_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4475:
bool test_mod_sqrt_zero_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4494:
bool test_mod_sqrt_mod2_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4514:
bool test_mod_sqrt_no_solution_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4534:
bool test_mod_sqrt_composite_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4553:
bool test_mod_sqrt_even_modulus_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4572:
bool test_is_probable_prime_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4592:
bool test_is_probable_prime_witness_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4609:
bool test_next_prime_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4628:
bool test_next_prime_small_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4651:
bool test_mul_nonzero_nonempty_result_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4670:
bool test_div_exact_i64_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4687:
bool test_mod_sqrt_tonelli_inner_loop_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Math.c:4725:
bool test_blind_mod_inv_correct(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Math.c:4745:
bool test_blind_mod_sqrt_tonelli(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Math.c:4768:
bool test_blind_mod_sqrt_fast_branch(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Math.c:4791:
bool test_blind_mod_sub_branches(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Math.c:4822:
bool test_blind_next_prime(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Math.c:4840:
bool test_blind_carmichael_is_composite(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Convert.c:1567:
bool test_to_str_radix_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Convert.c:1592:
bool test_from_bytes_be_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
u8 bytes[] = {0x01, 0x02, 0x03, 0x04};- In
Convert.c:1606:
bool test_from_str_nonempty_out_no_leak(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *a = ALLOCATOR_OF(&dbg);- In
Convert.c:1621:
bool test_blind_to_str_radix_big(void) {
DebugAllocator dbg = DebugAllocatorInitWith(blind_cfg());
Allocator *alloc = ALLOCATOR_OF(&dbg);- In
Write.c:4777:
#define LEAK_WRITE_PRELUDE() \
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG); \
Allocator *adbg = ALLOCATOR_OF(&dbg); \
Str out = StrInit(adbg); \- In
Write.c:5471:
for (int i = 0; i < 8; ++i)
StrPushBackR(&s, (char)0xAB);
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Str out = StrInit(ALLOCATOR_OF(&dbg));
bool ok = StrAppendFmt(&out, "{x}", s) && (StrLen(&out) > 0);- In
Write.c:5511:
// ---------------------------------------------------------------------------
bool test_leak_sci_nonzero_digits_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Write.c:5539:
// ---------------------------------------------------------------------------
bool test_leak_sci_zero_digits_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Write.c:5565:
// ---------------------------------------------------------------------------
bool test_leak_decimal_withdot_canonical_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Write.c:5592:
// ---------------------------------------------------------------------------
bool test_leak_decimal_nodot_canonical_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Write.c:5621:
// ---------------------------------------------------------------------------
bool test_leak_write_zstr_hex_per_byte_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Write.c:5645:
// ---------------------------------------------------------------------------
bool test_leak_write_i64_temp_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Read.c:2730:
// closing quote -> unterminated-quote branch frees the destination Str.
static bool leak_quoted_unterminated(Zstr input, Zstr fmt) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Str s = StrInit(ALLOCATOR_OF(&dbg));
Zstr p = input;- In
Read.c:2742:
// scratch (allocated through the destination BitVec's allocator).
static bool leak_bitvec_overflow(Zstr input) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
BitVec bv = BitVecInit(ALLOCATOR_OF(&dbg));
Zstr p = input;- In
Read.c:2770:
// 2439: unquoted invalid-escape error path frees the destination Str.
bool test_leak_read_unquoted_bad_escape_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Str s = StrInit(ALLOCATOR_OF(&dbg));
Zstr p = "aaaaaaaaaaaaaaaaaaaaaaaa\\q"; // 24 'a' + invalid \q
- In
Read.c:2790:
// exponent overflow -> fail branch frees the internal `temp` scratch.
bool test_leak_read_float_exp_overflow_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Float fv = FloatInit(ALLOCATOR_OF(&dbg));
Zstr p = "1e99999999999999999999999999999999999999999999999999";- In
Read.c:2816:
// ---------------------------------------------------------------------------
bool test_leak_read_int_prior_value_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- In
Read.c:2843:
// ---------------------------------------------------------------------------
bool test_leak_read_float_prior_value_freed(void) {
DebugAllocator dbg = DebugAllocatorInitWith(LEAK_CFG);
Allocator *adbg = ALLOCATOR_OF(&dbg);- 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:3094:
cfg.detect_overflow = false;
cfg.track_freed_history = false;
return DebugAllocatorInitWith(cfg);
}- In
Parse.c:629:
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