core: v2ray.com/core/common/bytespool Index | Files

package bytespool

import "v2ray.com/core/common/bytespool"

Index

Package Files

pool.go

func Alloc Uses

func Alloc(size int32) []byte

Alloc returns a byte slice with at least the given size. Minimum size of returned slice is 2048.

v2ray:api:stable

func Free Uses

func Free(b []byte)

Free puts a byte slice into the internal pool.

v2ray:api:stable

func GetPool Uses

func GetPool(size int32) *sync.Pool

GetPool returns a sync.Pool that generates bytes array with at least the given size. It may return nil if no such pool exists.

v2ray:api:stable

Package bytespool imports 1 packages (graph) and is imported by 9 packages. Updated 2019-04-20. Refresh now. Tools for package owners.