Documentation
¶
Overview ¶
Package memory provides memory management utilities including pooling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BufferPool = NewPool(func() *Buffer { return NewBuffer(8192) })
BufferPool is a pool for reusable buffers.
View Source
var ByteSlicePool = NewPool(func() []byte { return make([]byte, 0, 4096) })
ByteSlicePool is a pool for byte slices (4KB default capacity).
View Source
var Float64SlicePool = NewPool(func() []float64 { return make([]float64, 0, 1024) })
Float64SlicePool is a pool for float64 slices (1024 default capacity).
View Source
var IntSlicePool = NewPool(func() []int { return make([]int, 0, 1024) })
IntSlicePool is a pool for int slices (1024 default capacity).
View Source
var MapStringAnyPool = NewPool(func() map[string]any { return make(map[string]any, 256) })
MapStringAnyPool is a pool for map[string]any (256 default capacity).
View Source
var StringSlicePool = NewPool(func() []string { return make([]string, 0, 512) })
StringSlicePool is a pool for string slices (512 default capacity).
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a reusable buffer for efficient I/O operations.
Click to show internal directories.
Click to hide internal directories.