pool

package
Version: v2.0.0-beta.3+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

func NewBytesPool

func NewBytesPool(minSize, maxSize int, factor float64) *BytesPool

NewBytesPool returns a new BytesPool with size buckets for minSize to maxSize increasing by the given factor.

func (*BytesPool) Get

func (p *BytesPool) Get(sz int) []byte

Get returns a new byte slices that fits the given size.

func (*BytesPool) Put

func (p *BytesPool) Put(b []byte)

Put returns a byte slice to the right bucket in the pool.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL