Movatterモバイル変換


[0]ホーム

URL:


memory

package
v1.1.3Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License:BSD-3-ClauseImports:1Imported by:0

Details

Repository

github.com/extism/go-pdk

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcExtismFree

func ExtismFree(offsetExtismPointer)

extismFree releases the bytes previously allocated with `extism_alloc` at the given `offset`.

funcExtismLength

func ExtismLength(offsetExtismPointer)uint64

extismLength returns the number of bytes associated with the block of host memorylocated at `offset`.

funcExtismLengthUnsafe

func ExtismLengthUnsafe(ExtismPointer)uint64

funcExtismLoadU64

func ExtismLoadU64(offsetExtismPointer)uint64

extismLoadU64 returns the 64-bit unsigned integer at location `offset` in the host memory block.Note that `offset` must lie on an 8-byte boundary.

funcExtismLoadU8

func ExtismLoadU8(offsetExtismPointer)uint8

funcExtismStoreU64

func ExtismStoreU64(offsetExtismPointer, vuint64)

extismStoreU64 stores the 64-bit unsigned integer value `v` at location `offset` in the host memory block.Note that `offset` must lie on an 8-byte boundary.

funcExtismStoreU8

func ExtismStoreU8(offsetExtismPointer, vuint8)

funcLoad

func Load(offsetExtismPointer, buf []byte)

funcStore

func Store(offsetExtismPointer, buf []byte)

Types

typeExtismPointer

type ExtismPointeruint64

funcExtismAlloc

func ExtismAlloc(lengthuint64)ExtismPointer

extismAlloc allocates `length` bytes of data with host memory for use by the pluginand returns its offset within the host memory block.

typeMemory

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

Memory represents memory allocated by (and shared with) the host.

funcAllocate

func Allocate(lengthint)Memory

Allocate allocates `length` uninitialized bytes on the host.

funcAllocateBytes

func AllocateBytes(data []byte)Memory

AllocateBytes allocates and saves the `data` into Memory on the host.

funcNewMemory

func NewMemory(offsetExtismPointer, lengthuint64)Memory

func (*Memory)Free

func (m *Memory) Free()

Free frees the host memory block.

func (*Memory)Length

func (m *Memory) Length()uint64

Length returns the number of bytes in the host memory block.

func (*Memory)Load

func (m *Memory) Load(buffer []byte)

Load copies the host memory block to the provided `buffer` byte slice.

func (*Memory)Offset

func (m *Memory) Offset()uint64

Offset returns the offset of the host memory block.

func (*Memory)ReadBytes

func (m *Memory) ReadBytes() []byte

ReadBytes returns the host memory block as a slice of bytes.

func (*Memory)Store

func (m *Memory) Store(data []byte)

Store copies the `data` byte slice into host memory.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp