Arena¶
No import is needed.
A manually freed value handle for mixed unmanaged allocations. Initial capacity counts bytes. Growth adds blocks without moving existing allocations. Reset invalidates all pointers and retains every block for reuse; free releases all blocks and state. Arena allocations cannot be individually freed or resized. Copies alias the same state, which must be freed once. Allocation, reset, free and construction require @unsafe.
Arena¶
Copies alias one manually owned state. Reset/free invalidates every allocation; dropping this value does not free anything, and individual allocations must never be freed.
constructor¶
Creates an arena with the requested initial byte capacity. Call free when finished.
alloc¶
Allocates storage for count values of T. Initialize values before reading them.
alloc_zeroed¶
Allocates zero-filled storage for count values. The arena owns it until reset or free.
reset¶
Discards all arena allocations for reuse. All pointers obtained from this arena become invalid.
free¶
Releases the arena and all its storage. All copies and allocated pointers become invalid.