Class PanamaMemory
java.lang.Object
ai.tegmentum.wasmtime4j.panama.PanamaMemory
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.WasmMemory
Panama FFI implementation of WebAssembly Memory.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionintatomicAddInt(int offset, int value) longatomicAddLong(int offset, long value) intatomicAndInt(int offset, int value) longatomicAndLong(int offset, long value) intatomicCompareAndSwapInt(int offset, int expected, int newValue) longatomicCompareAndSwapLong(int offset, long expected, long newValue) voidintatomicLoadInt(int offset) longatomicLoadLong(int offset) intatomicNotify(int offset, int count) intatomicOrInt(int offset, int value) longatomicOrLong(int offset, long value) voidatomicStoreInt(int offset, int value) voidatomicStoreLong(int offset, long value) ai.tegmentum.wasmtime4j.WaitResultatomicWait32(int offset, int expected, long timeoutNanos) ai.tegmentum.wasmtime4j.WaitResultatomicWait64(int offset, long expected, long timeoutNanos) intatomicXorInt(int offset, int value) longatomicXorLong(int offset, long value) voidclose()Closes the memory and releases resources.voidcopy(int destOffset, int srcOffset, int length) longdataPtr()longdataSize()voiddropDataSegment(int dataSegmentIndex) voidfill(int offset, byte value, int length) intai.tegmentum.wasmtime4j.type.MemoryTypeGets the native memory pointer.intgetSize()longintgrow(int pages) longgrow64(long pages) longgrowAsync(long pages) voidinit(int destOffset, int dataSegmentIndex, int srcOffset, int length) booleanisShared()intpageSize()intbytereadByte(int offset) voidreadBytes(int offset, byte[] dest, int destOffset, int length) voidreadBytes64(long offset, byte[] dest, int destOffset, int length) booleanvoidwriteByte(int offset, byte value) voidwriteBytes(int offset, byte[] src, int srcOffset, int length) voidwriteBytes64(long offset, byte[] src, int srcOffset, int length) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.tegmentum.wasmtime4j.WasmMemory
copy, copy64, fill, fill64, getMaxSize64, getMaxSizeInBytes64, getMinSize, getSizeInBytes64, init64, readByte64, readFloat32, readFloat64, readInt32, readInt64, size, writeByte64, writeFloat32, writeFloat64, writeInt32, writeInt64
-
Method Details
-
dataPtr
public long dataPtr()- Specified by:
dataPtrin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
pageSizeLog2
public int pageSizeLog2()- Specified by:
pageSizeLog2in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
pageSize
public int pageSize()- Specified by:
pageSizein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
dataSize
public long dataSize()- Specified by:
dataSizein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
getSize
public int getSize()- Specified by:
getSizein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
grow
public int grow(int pages) - Specified by:
growin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
getMaxSize
public int getMaxSize()- Specified by:
getMaxSizein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
getBuffer
- Specified by:
getBufferin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
readByte
public byte readByte(int offset) - Specified by:
readBytein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
writeByte
public void writeByte(int offset, byte value) - Specified by:
writeBytein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
readBytes
public void readBytes(int offset, byte[] dest, int destOffset, int length) - Specified by:
readBytesin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
writeBytes
public void writeBytes(int offset, byte[] src, int srcOffset, int length) - Specified by:
writeBytesin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
copy
public void copy(int destOffset, int srcOffset, int length) - Specified by:
copyin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
fill
public void fill(int offset, byte value, int length) - Specified by:
fillin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
init
public void init(int destOffset, int dataSegmentIndex, int srcOffset, int length) - Specified by:
initin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
dropDataSegment
public void dropDataSegment(int dataSegmentIndex) - Specified by:
dropDataSegmentin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
getMemoryType
public ai.tegmentum.wasmtime4j.type.MemoryType getMemoryType()- Specified by:
getMemoryTypein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicCompareAndSwapInt
public int atomicCompareAndSwapInt(int offset, int expected, int newValue) - Specified by:
atomicCompareAndSwapIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicCompareAndSwapLong
public long atomicCompareAndSwapLong(int offset, long expected, long newValue) - Specified by:
atomicCompareAndSwapLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicLoadInt
public int atomicLoadInt(int offset) - Specified by:
atomicLoadIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicLoadLong
public long atomicLoadLong(int offset) - Specified by:
atomicLoadLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicStoreInt
public void atomicStoreInt(int offset, int value) - Specified by:
atomicStoreIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicStoreLong
public void atomicStoreLong(int offset, long value) - Specified by:
atomicStoreLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicAddInt
public int atomicAddInt(int offset, int value) - Specified by:
atomicAddIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicAddLong
public long atomicAddLong(int offset, long value) - Specified by:
atomicAddLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicAndInt
public int atomicAndInt(int offset, int value) - Specified by:
atomicAndIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicOrInt
public int atomicOrInt(int offset, int value) - Specified by:
atomicOrIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicXorInt
public int atomicXorInt(int offset, int value) - Specified by:
atomicXorIntin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicAndLong
public long atomicAndLong(int offset, long value) - Specified by:
atomicAndLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicOrLong
public long atomicOrLong(int offset, long value) - Specified by:
atomicOrLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicXorLong
public long atomicXorLong(int offset, long value) - Specified by:
atomicXorLongin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
readBytes64
public void readBytes64(long offset, byte[] dest, int destOffset, int length) - Specified by:
readBytes64in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
writeBytes64
public void writeBytes64(long offset, byte[] src, int srcOffset, int length) - Specified by:
writeBytes64in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
getSize64
public long getSize64()- Specified by:
getSize64in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
grow64
public long grow64(long pages) - Specified by:
grow64in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
supports64BitAddressing
public boolean supports64BitAddressing()- Specified by:
supports64BitAddressingin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicFence
public void atomicFence()- Specified by:
atomicFencein interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicNotify
public int atomicNotify(int offset, int count) - Specified by:
atomicNotifyin interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicWait32
public ai.tegmentum.wasmtime4j.WaitResult atomicWait32(int offset, int expected, long timeoutNanos) - Specified by:
atomicWait32in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
atomicWait64
public ai.tegmentum.wasmtime4j.WaitResult atomicWait64(int offset, long expected, long timeoutNanos) - Specified by:
atomicWait64in interfaceai.tegmentum.wasmtime4j.WasmMemory
-
growAsync
public long growAsync(long pages) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
growAsyncin interfaceai.tegmentum.wasmtime4j.WasmMemory- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
close
public void close()Closes the memory and releases resources. -
getNativeMemory
Gets the native memory pointer.For instance-exported memories, this method looks up the memory pointer by name. For store-created memories, it returns the stored native pointer.
- Returns:
- native memory segment, or NULL if the memory pointer cannot be obtained
-