memory

package
v1.7.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: LGPL-3.0, BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	//VM_NIL_POINTER = math.MaxInt64
	VM_NIL_POINTER = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PType

type PType int
const (
	PInt8 PType = iota
	PInt16
	PInt32
	PInt64
	PFloat32
	PFloat64
	PString
	PStruct
	PUnkown
)

type TypeLength

type TypeLength struct {
	Ptype  PType
	Length int
}

type VMmemory

type VMmemory struct {
	Memory          []byte
	AllocedMemIdex  int
	PointedMemIndex int
	ParamIndex      int //args analyze pointer
	MemPoints       map[uint64]*TypeLength
}

func (*VMmemory) GetPointerMemSize

func (vm *VMmemory) GetPointerMemSize(addr uint64) int

return pointed memory size

func (*VMmemory) GetPointerMemory

func (vm *VMmemory) GetPointerMemory(addr uint64) ([]byte, error)

return pointed memory when wasm returns a pointer, call this function to get the pointed memory

func (*VMmemory) Malloc

func (vm *VMmemory) Malloc(size int) (int, error)

Alloc memory for base types, return the address in memory

func (*VMmemory) MallocPointer

func (vm *VMmemory) MallocPointer(size int, p_type PType) (int, error)

Alloc memory for pointer types, return the address in memory

func (*VMmemory) SetMemory

func (vm *VMmemory) SetMemory(val interface{}) (int, error)

set base types into memory, return address of memory

func (*VMmemory) SetPointerMemory

func (vm *VMmemory) SetPointerMemory(val interface{}) (int, error)

set pointer types into memory, return address of memory

func (*VMmemory) SetStructMemory

func (vm *VMmemory) SetStructMemory(val interface{}) (int, error)

set struct into memory , return address of memory

Jump to

Keyboard shortcuts

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