pool

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Variable sized pools of bytes using sync.Pools underneath.

Index

Constants

View Source
const MaxSize = 1 << 23

MaxSize is the supported maximum size

Variables

This section is empty.

Functions

func ByteGet

func ByteGet(size int) []byte

Alloc a slice of bytes with the given size. Sizes till MaxSize are supported, for larger sizes nil will be returned. The slices are taken from sync.Pool caches sized to the nearest power of two and truncated to the size supplied. This function may be called concurrently.

func BytePut

func BytePut(bs []byte)

Free a byte slice allocated by Alloc. The argument may be shorted from the original allocation, it is reset to len = cap. This function may be called concurrently.

Types

This section is empty.

Jump to

Keyboard shortcuts

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