From 44486c86d226797efb5452a5d905875902caaec3 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 21 Mar 2025 11:21:55 +0100 Subject: [PATCH] docs: add instruction metering section to build_wamr documentation --- doc/build_wamr.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/build_wamr.md b/doc/build_wamr.md index b8cfcc989..33970eb01 100644 --- a/doc/build_wamr.md +++ b/doc/build_wamr.md @@ -323,6 +323,10 @@ And the wasm app can calls below APIs to allocate/free memory from/to the shared - **WAMR_BUILD_SHRUNK_MEMORY**=1/0, default to enable if not set > Note: When enabled, this feature will reduce memory usage by decreasing the size of the linear memory, particularly when the `memory.grow` opcode is not used and memory usage is somewhat predictable. +## **Instruction metering** +- **WAMR_BUILD_INSTRUCTION_METERING**=1/0, default to disable if not set +> Note: Enabling this feature allows limiting the number of instructions a wasm module instance can execute. Use the `wasm_runtime_set_instruction_count_limit(...)` API before calling `wasm_runtime_call_*(...)` APIs to enforce this limit. + ## **Combination of configurations:** We can combine the configurations. For example, if we want to disable interpreter, enable AOT and WASI, we can run command: