Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSlicePool ¶
type ByteSlicePool struct { MinCap int // contains filtered or unexported fields }
ByteSlicePool is a wrapper around sync.Pool to get []byte objects with a given capacity.
func NewByteSlicePool ¶
func NewByteSlicePool(minCap int) *ByteSlicePool
NewByteSlicePool returns a new ByteSlicePool object.
func (ByteSlicePool) Get ¶
func (sp ByteSlicePool) Get(capacity int) []byte
Get a slice from the pool. The capacity parameter is used only if we need to allocate a new byte slice; there's no guarantee a slice retrieved from the pool will have enough capacity for that.
Click to show internal directories.
Click to hide internal directories.