Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arena ¶
type Arena[T any] struct { // contains filtered or unexported fields }
Arena is a generic arena allocator that pre-allocates a slice and provides goroutine-safe allocation of individual items or batches
func (*Arena[T]) Alloc ¶
Alloc allocates a single item from the arena. Returns a pointer to the item and true if allocated from arena, or a pointer to a heap-allocated item and false if arena is full.
Click to show internal directories.
Click to hide internal directories.