common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Allocations = &MemMgr{
	memories:  make(map[uint32]*Mem),
	resources: make(map[uint32]*Mem),
}

Functions

func Alloc added in v0.2.0

func Alloc(size uint32) uint32

func BytesToPointer

func BytesToPointer(v []byte) (addr, size uint32)

func FreeResource added in v0.2.0

func FreeResource(rid uint32) bool

func StringToPointer

func StringToPointer(v string) (addr, size uint32)

Types

type Mem added in v0.2.0

type Mem struct {
	Addr uint32
	Size uint32
	Data []byte
}

func NewMemory added in v0.2.0

func NewMemory(size uint32) *Mem

type MemMgr added in v0.2.0

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

func (*MemMgr) AddAllocation added in v0.2.0

func (mm *MemMgr) AddAllocation(size uint32) *Mem

func (*MemMgr) AddResource added in v0.2.0

func (mm *MemMgr) AddResource(rid, size uint32) *Mem

func (*MemMgr) AddResourceWithMem added in v0.2.0

func (mm *MemMgr) AddResourceWithMem(rid uint32, m *Mem)

func (*MemMgr) FreeResource added in v0.2.0

func (mm *MemMgr) FreeResource(rid uint32) bool

func (*MemMgr) GetByAddr added in v0.2.0

func (mm *MemMgr) GetByAddr(ptr uint32) *Mem

func (*MemMgr) GetByRID added in v0.2.0

func (mm *MemMgr) GetByRID(rid uint32) *Mem

Jump to

Keyboard shortcuts

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