From 1c89a378992067f48c9b260a7f47f8a248f5ba50 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 12 Oct 2022 21:04:59 +0900 Subject: [PATCH] export_native_api.md: Relax the "ground rule" (#1577) Nothing wrong with passing structures and function pointers as far as the native code is aware of and careful about the ABI used in the wasm module. --- doc/export_native_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/export_native_api.md b/doc/export_native_api.md index 684c1cfb..7b7dd17d 100644 --- a/doc/export_native_api.md +++ b/doc/export_native_api.md @@ -189,7 +189,7 @@ void foo2(wasm_exec_env_t exec_env, The runtime builder should ensure not broking the memory sandbox when exporting the native function to WASM. -A few key ground rules: +A few recommendations: - Never pass any structure/class object pointer to native (do data serialization instead) - Do the pointer address conversion in the native API if "$\*" is not used for the pointer in the function signature