Esc

structure_allocator

procedureextensionsince 0.36.1Source
  • macOS: structure_allocator works on macOS
  • Linux: structure_allocator works on Linux
  • Windows: structure_allocator works on Windows
  • Wasm: structure_allocator works on Wasm

Allocates arrays and message objects from a stable per-decode arena. Array allocators retain this heap header, never a Reader or another stack variable. Growing the newest allocation extends it in place; any other outgrown buffer becomes scrap that later allocations are carved from, so growth leaves no dead space.

Signature

structure_allocator :: (
    mode: Allocator_Mode,
    size: s64,
    old_size: s64,
    old: *void,
    data: *void
) -> *void

See also