mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 06:55:07 +00:00
7692f32a94
This PR adds a max_memory_pages parameter to module instantiation APIs, to allow overriding the max memory defined in the WASM module. Sticking to the max memory defined in the module is quite limiting when using shared memory in production. If targeted devices have different memory constraints, many wasm files have to be generated with different max memory values. And device constraints may not be known in advance. Being able to set the max memory value during module instantiation allows to reuse the same wasm module, e.g. by retrying instantiation with different max memory value. |
||
---|---|---|
.. | ||
src/wamr | ||
utils | ||
wamr-api | ||
wasm-c-api | ||
.gitignore | ||
LICENSE | ||
MANIFEST.in | ||
pyproject.toml | ||
README.md | ||
setup.py |
wamr-python
The WAMR Python package contains a set of high-level bindings for WAMR API and WASM-C-API.
Installation
- Notice: This python package need python >=
3.9
.
To Install from local source tree in development mode run the following command,
python -m pip install -e .
In this mode the package appears to be installed but still is editable from the source tree.
Usage
From the same package you can use two set of APIs.
To use the WAMR API you can import the symbols as follows,
from wamr.wamrapi.wamr import Engine, Module, Instance, ExecEnv
In the order hand, to use the WASM-C-API,
import wamr.wasmcapi.ffi as ffi
For more information: