UI module

frame_allocator

procedureextensionexperimentalsince 0.31.0Source

The allocator of the per-frame arena: memory that lives until the next frame begins.

Example↗
ui := headless();
defer free_ui(*ui);
scratch := alloc(16,, frame_allocator(*ui));  // freed when the next frame begins
assert(scratch != null);
frame_allocator :: (ui: *UI_State) -> Allocator

The allocator of the per-frame arena: memory that lives until the next frame begins.

Parameters

ui: *UI_State
the UI whose frame arena to use.

Returns

Allocator
Example↗
ui := headless();
defer free_ui(*ui);
scratch := alloc(16,, frame_allocator(*ui));  // freed when the next frame begins
assert(scratch != null);

See also