Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPoolExhausted = errors.New("pool exhausted")
ErrPoolExhausted is returned if a pool cannot provide the request bytes.
Functions ¶
This section is empty.
Types ¶
type BytesPool ¶
type BytesPool struct {
// contains filtered or unexported fields
}
BytesPool is a bucketed pool for variably sized byte slices. It can be configured to not allow more than a maximum number of bytes being used at a given time. Every byte slice obtained from the pool must be returned.
func NewBytesPool ¶
NewBytesPool returns a new BytesPool with size buckets for minSize to maxSize increasing by the given factor and maximum number of used bytes. No more than maxTotal bytes can be used at any given time unless maxTotal is set to 0.
Click to show internal directories.
Click to hide internal directories.