Esc

release_all_allocations

proceduresince 0.36.1Source
  • macOS: release_all_allocations works on macOS
  • Linux: release_all_allocations works on Linux
  • Windows: release_all_allocations works on Windows
  • Wasm: release_all_allocations works on Wasm

Tells the memory debugger that a has given back everything it handed out at once, as a bump allocator does when it resets or is finalized: every range it owns stops being live, and later ones are tracked as new. Does nothing when the debugger is off. Call it from the reset and fini of an allocator that ignores .FREE.

Signature

release_all_allocations :: (a: Allocator)
Example↗
arena: int;
arena_proc :: (mode: Allocator_Mode, size: s64, old_size: s64, old_memory: *void, data: *void) -> *void {
    return null;
}
release_all_allocations(Allocator.{ arena_proc, *arena }); // call this from the arena's reset

See also