Documentation
¶
Overview ¶
Package chunks carves single values and short runs of a type from fixed-size off-heap chunks, the storage behind typedarena, pool and intern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSize reports a chunk size that is not positive. ErrSize = errors.New("chunk size must be positive") // ErrZeroSize reports a type with no bytes to pool. ErrZeroSize = errors.New("pool of a zero-size type") )
Functions ¶
This section is empty.
Types ¶
type Chunks ¶
type Chunks[T any] struct { // contains filtered or unexported fields }
Chunks hands out zeroed Ts from chunks of a fixed size. Runs longer than a chunk get a chunk of their own.
func (*Chunks[T]) Reset ¶
Reset makes all chunk memory available again, zeroed, and frees the oversized runs.