mem

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEnoughMemory = errors.New("not enough memory")

Functions

func MemoryGrowCheck

func MemoryGrowCheck(growSize uint64) error

Types

type GrowCheck

type GrowCheck func(growSize uint64) error

type LinearMemory

type LinearMemory interface {
	// 线程不安全
	Reallocate(size uint64) (all []byte, err error)
	Free() error
}

func NewGuardedMemory

func NewGuardedMemory(cap, max uint64) (m LinearMemory, err error)

func NewMemory

func NewMemory(cap, max uint64) (LinearMemory, error)

Jump to

Keyboard shortcuts

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