Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is a pool for bytes.Buffer objects
func (*BufferPool) Get ¶
func (p *BufferPool) Get() *bytes.Buffer
Get retrieves a buffer from the pool
func (*BufferPool) Put ¶
func (p *BufferPool) Put(buf *bytes.Buffer)
Put returns a buffer to the pool
type ByteSlicePool ¶
type ByteSlicePool struct {
// contains filtered or unexported fields
}
ByteSlicePool is a pool for byte slices of a specific size
func NewByteSlicePool ¶
func NewByteSlicePool(size int) *ByteSlicePool
NewByteSlicePool creates a pool for byte slices
func (*ByteSlicePool) Get ¶
func (p *ByteSlicePool) Get() []byte
Get retrieves a byte slice from the pool
func (*ByteSlicePool) Put ¶
func (p *ByteSlicePool) Put(b []byte)
Put returns a byte slice to the pool
type MapPool ¶
type MapPool[K comparable, V any] struct { // contains filtered or unexported fields }
MapPool provides pooling for maps
func NewMapPool ¶
func NewMapPool[K comparable, V any]() *MapPool[K, V]
NewMapPool creates a new map pool
type ObjectPool ¶
type ObjectPool[T any] struct { // contains filtered or unexported fields }
ObjectPool provides a generic object pool for reducing allocations
func NewObjectPool ¶
func NewObjectPool[T any](new func() T, reset func(T)) *ObjectPool[T]
NewObjectPool creates a new object pool
func (*ObjectPool[T]) Put ¶
func (p *ObjectPool[T]) Put(obj T)
Put returns an object to the pool after resetting it
type SlicePool ¶
type SlicePool[T any] struct { // contains filtered or unexported fields }
SlicePool provides pooling for slices
func NewSlicePool ¶
NewSlicePool creates a new slice pool
Click to show internal directories.
Click to hide internal directories.