mempool

package
v0.0.0-...-db2842b Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMemPool = New(64)

DefaultMemPool .

Functions

func Free

func Free(buf []byte)

Free exports default package method.

func Malloc

func Malloc(size int) []byte

Malloc exports default package method.

func Realloc

func Realloc(buf []byte, size int) []byte

Realloc exports default package method.

Types

type Allocator

type Allocator interface {
	Malloc(size int) []byte
	Realloc(buf []byte, size int) []byte
	Free(buf []byte)
}

func New

func New(minSize int) Allocator

New .

type MemPool

type MemPool struct {
	Debug bool
	// contains filtered or unexported fields
}

MemPool .

func (*MemPool) Free

func (mp *MemPool) Free(buf []byte)

Free .

func (*MemPool) Malloc

func (mp *MemPool) Malloc(size int) []byte

Malloc .

func (*MemPool) Realloc

func (mp *MemPool) Realloc(buf []byte, size int) []byte

Realloc .

type NativeAllocator

type NativeAllocator struct{}

NativeAllocator definition.

func (*NativeAllocator) Free

func (a *NativeAllocator) Free(buf []byte)

Free .

func (*NativeAllocator) Malloc

func (a *NativeAllocator) Malloc(size int) []byte

Malloc .

func (*NativeAllocator) Realloc

func (a *NativeAllocator) Realloc(buf []byte, size int) []byte

Realloc .

Jump to

Keyboard shortcuts

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