Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pooler ¶
type Pooler interface { // Bytes with zero length. If giving back to pool, the // original pointer should be Put. Get() *Bytes SizedPooler }
func NewDynamic ¶
func NewDynamic() Pooler
Continually tunes the Get allocation size and max Put size. Suitable for variable sized Bytes, but at a cost.
type SizedPooler ¶
type SizedPooler interface { // Bytes with zero length and minimum capacity c. If giving back // to pool, the original pointer should be Put. GetGrown(c int) *Bytes // Can be nil. Do not use Bytes after Put. Put(*Bytes) }
func NewBucket ¶
func NewBucket(minSize, maxSize int) SizedPooler
Suitable for variable sized Bytes if max bounds can be chosen. Uses buckets of sizes that increase with the power of two. Puts over maxSize will be allocated directly.
Click to show internal directories.
Click to hide internal directories.