Class WasmModule
java.lang.Object
ai.tegmentum.webassembly4j.runtime.WasmModule
- All Implemented Interfaces:
AutoCloseable
-
Method Summary
Modifier and TypeMethodDescription<T extends AutoCloseable>
T<R> RInvokes a function using a shared instance.voidInvokes a void function using a shared instance.voidclose()Creates a new isolated instance of this module.
-
Method Details
-
call
Invokes a function using a shared instance. The shared instance is created lazily on first call and reused for subsequent calls. State mutations (globals, memory) persist across calls. UsenewInstance()for isolated execution. -
callVoid
Invokes a void function using a shared instance. The shared instance is created lazily on first call and reused for subsequent calls. State mutations (globals, memory) persist across calls. UsenewInstance()for isolated execution. -
newInstance
Creates a new isolated instance of this module. -
bind
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-