Basic module

push_allocator

procedure2 overloadsSource

Makes allocator the context.allocator until the end of the enclosing scope, then puts the old one back.

push_allocator :: (allocator: Allocator)

Parameters

allocator: Allocator
Example↗
{
    push_allocator(temp);
    text := sprint("%", 123); // lives in temporary storage
    assert(text == "123");
}
reset_temporary_storage();
push_allocator :: (proc: Allocator_Proc, data: *void)

Makes Allocator.{proc, data} the context.allocator until the end of the enclosing scope.

Parameters

proc: Allocator_Proc
the allocator procedure.
data: *void
handed to proc on every call.

See also