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.
Click to show internal directories.
Click to hide internal directories.