Workspaces
RAII-style memory management for C.
Concept & Motivation
API Reference
Workspace
WorkspaceWorkspace scratch = arena.create(u64 size);void process_request() {
// 1. Create a Workspace
Workspace scratch = arena.create(1024);
// 2. Allocate and work
String data = io.slurp(&scratch, "user.json");
if (data.len == 0) {
return; // Safe! 'scratch' is released automatically.
}
io.print("Processing: %S\n", data);
} // 'scratch' is released here automatically.Last updated