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

package bytespool

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


Package Files


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.


func Free Uses

func Free(b []byte)

Free puts a byte slice into the internal pool.


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.


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).