Skip to documentation
SLOP

tiny.deadalloc.Config

Reference tiny.deadalloc Config

Defined in tiny.deadalloc.

API (10)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.deadallocConfig
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/deadalloc/src/allocator.zig:22

zig
pub const Config = struct {    mode: Mode = .diehard,    numerator: usize = 8,    denominator: usize = 7,    seed: u64 = 0xd1e4_a110_cafe_f00d,    thread_safe: bool = true,    min_chunk_blocks: usize = 64,    diagnostics: DiagnosticConfig = .{},    repairs: exterminator.RepairTable = .{},    pub fn diagnostic(mode: Mode) Config {        return .{            .mode = mode,            .diagnostics = .{ .enabled = true },        };    }    pub fn repaired(current: Config, report: report_mod.Report) Config {        var next = current;        const policy = exterminator.RepairPolicy.fromReport(report, .{            .red_zone_bytes = current.diagnosticRedZoneBytes(),            .quarantine_epochs = current.quarantineEpochs(),            .repairs = current.repairs,        });        next.mode = .exterminator;        next.diagnostics.enabled = true;        next.diagnostics.red_zone_bytes = policy.red_zone_bytes;        next.diagnostics.quarantine_epochs = policy.quarantine_epochs;        next.repairs = policy.repairs;        return next;    }    fn diagnosticRedZoneBytes(self: Config) usize {        if (self.diagnostics.enabled or self.mode == .exterminator) return self.diagnostics.red_zone_bytes;        return 0;    }    fn quarantineEpochs(self: Config) u64 {        return switch (self.mode) {            .diehard => 0,            .dieharder => @max(self.diagnostics.quarantine_epochs, 8),            .exterminator => @max(self.diagnostics.quarantine_epochs, 1),        };    }    fn repairPadding(self: Config, allocation_return_address: usize) usize {        if (self.mode != .exterminator) return 0;        return self.repairs.overflowPadding(allocation_return_address);    }    fn repairQuarantineEpochs(self: Config, allocation_return_address: usize, free_return_address: usize) u64 {        const base = self.quarantineEpochs();        if (self.mode != .exterminator) return base;        return @max(base, self.repairs.lifeExtension(allocation_return_address, free_return_address));    }};

Source: lib/deadalloc/src/root.zig:45

zig
pub const Config = allocator_mod.Config;
Called byCallsNo direct callstest sourcelib.deadalloc.src.allocatortest: deinit releases reported large ...test sourcelib.deadalloc.src.allocatortest: diagnostic freed patterns detec...test sourcelib.deadalloc.src.allocatortest: diagnostic invalid free reports...test sourcelib.deadalloc.src.allocatortest: diagnostic raw remap rejects fr...test sourcelib.deadalloc.src.allocatortest: diagnostic raw remap rejects un...+9 moreConfigdiagnostic
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.deadalloc.src.allocatortest: repair config adds overflow pad...test sourcelib.deadalloc.src.allocatortest: repair config applies dangle ex...test sourcelib.deadalloc.src.allocatortest: repair config applies overflow ...RepairPolicyfromReportConfigrepaired
Static calls · unresolved targets: 0 · external targets: 2.

Complete caller list for Config.diagnostic

14 direct callers.

Audit

Definitions3
Public names3
Members8
Version26.7.0
Revisiondaab053ee433