bytespool

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package bytespool provides a sync.Pool with *[]byte to reduce memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireBytes

func AcquireBytes() *[]byte

AcquireBytes acquires the []byte from pool.

func ReleaseBytes

func ReleaseBytes(b *[]byte)

ReleaseBytes releases the []byte to pool.

Types

type Pool

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

Pool wraps the sync.Pool with *[]byte.

func NewPool

func NewPool() *Pool

NewPool creates a pool.

func (*Pool) Acquire

func (p *Pool) Acquire() *[]byte

Acquire releases the []byte from pool.

func (*Pool) Release

func (p *Pool) Release(b *[]byte)

Release releases the []byte to pool.

Jump to

Keyboard shortcuts

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