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

package bytespool

import "github.com/v2ray/v2ray-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). Updated 2019-01-21. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).