Basic module

temp

constantSource

The temporary allocator: a scratch heap that is never freed piece by piece. Everything in it goes away together when reset_temporary_storage runs, which a program typically does once per frame or request. Use it for short-lived results so there is nothing to track or free. Set context.allocator = temp or use push_allocator(temp) to send allocations there.

Example↗
text := tprint("%, %", 1, 2); // allocated in temporary storage
assert(text == "1, 2");
reset_temporary_storage();
temp :: Allocator.{ temporary_allocator_proc, null }

See also