slicepool

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: GPL-3.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 SlicePool

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

SlicePool is a pool of []byte. Typically *[]byte is preferred to avoid heap allocation. However in our case, the slice sizes are different, making them not feasible to reuse directly, so we only reuse the underlying array.

func NewSlicePool

func NewSlicePool(len int) SlicePool

func (*SlicePool) Get

func (p *SlicePool) Get() []byte

func (*SlicePool) Put

func (p *SlicePool) Put(s []byte)

Jump to

Keyboard shortcuts

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