bytespool

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alloc

func Alloc(size int) []byte

Alloc returns a bytes slice with the size. Make a new bytes slice if oversize.

func Free

func Free(b []byte)

Free puts the bytes slice into suitable pool. Discard the bytes slice if oversize.

func GetPool

func GetPool(size int) *sync.Pool

GetPool returns a sync.Pool that generates bytes slice with the size. Return nil if no such pool exists.

func Zero

func Zero(b []byte)

Zero clean up the bytes slice b to zero.

Types

This section is empty.

Jump to

Keyboard shortcuts

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