Skip to content

Commit 7bb3ad6

Browse files
committed
docs: clarify that * in signatures does address conversion
It was non-obvious that `*` means the runtime does the app to native conversion automatically. With the current docstring, one might assume that the runtime only does boundary checks and not address conversion. Under this assumption, passing the already-native address to `wasm_runtime_addr_app_to_native` will lead to unexpected behavior
1 parent ba9f9d1 commit 7bb3ad6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

core/iwasm/include/wasm_export.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,9 @@ wasm_table_type_get_max_size(const wasm_table_type_t table_type);
17401740
* auto check its boundary before calling the native function.
17411741
* If it is followed by '~', the checked length of the pointer
17421742
* is gotten from the following parameter, if not, the checked
1743-
* length of the pointer is 1.
1743+
* length of the pointer is 1. The runtime will also convert
1744+
* the app pointer to a native pointer, thus there is no need
1745+
* to manually call `wasm_runtime_addr_app_to_native`.
17441746
* '~': the parameter is the pointer's length with i32 type, and must
17451747
* follow after '*'
17461748
* '$': the parameter is a string (i32 in WASM), and runtime will

0 commit comments

Comments
 (0)