virtualmem

package
v0.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustBufferSize

func AdjustBufferSize(size int) int

func Put

func Put(mem *VirtualMem)

Put returns the virtual memory to the built-in pool.

Types

type Pool

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

func NewPool

func NewPool() Pool

func (*Pool) Get

func (p *Pool) Get(size int) *VirtualMem

Get retrieves a byte slice of the length requested by the caller from pool or allocates a new one.

func (*Pool) Put

func (p *Pool) Put(mem *VirtualMem)

Put returns the virtual memory to the pool.

type VirtualMem

type VirtualMem struct {
	Buf  []byte
	Size int
}

func Get

func Get(size int) *VirtualMem

func NewVirtualMem

func NewVirtualMem(size int) *VirtualMem

func (*VirtualMem) Zeroes

func (m *VirtualMem) Zeroes()

Jump to

Keyboard shortcuts

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