byteslice

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(size int) []byte

Get 从builtinPool中返回一个长度为size的byte slice

func Put

func Put(buf []byte)

Put 向builtinPool中归还byte slice

Types

type Pool

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

Pool 有32个sync.Pool,代表byte slice的长度(2的幂次方)

func (*Pool) Get

func (p *Pool) Get(size int) []byte

func (*Pool) Put

func (p *Pool) Put(buf []byte)

Jump to

Keyboard shortcuts

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