bpool

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytePoolCap

type BytePoolCap struct {
	// contains filtered or unexported fields
}

BytePoolCap implements a leaky pool of []byte in the form of a bounded channel.

func NewBytePoolCap

func NewBytePoolCap(maxSize int, width int, capwidth int) (bp *BytePoolCap)

NewBytePoolCap creates a new BytePool bounded to the given maxSize, with new byte arrays sized based on width.

func (*BytePoolCap) Get

func (bp *BytePoolCap) Get() (b []byte)

Get gets a []byte from the BytePool, or creates a new one if none are available in the pool.

func (*BytePoolCap) Put

func (bp *BytePoolCap) Put(b []byte)

Put returns the given Buffer to the BytePool.

func (*BytePoolCap) Width

func (bp *BytePoolCap) Width() (n int)

Width returns the width of the byte arrays in this pool.

func (*BytePoolCap) WidthCap

func (bp *BytePoolCap) WidthCap() (n int)

WidthCap returns the cap width of the byte arrays in this pool.

Jump to

Keyboard shortcuts

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