From daad09d0fe52911439ffcd404776018c0570a64c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 3 Aug 2024 19:47:56 +0900 Subject: [PATCH] examples/wasm2cstruct/README.md: random notes --- examples/wasm2cstruct/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/wasm2cstruct/README.md b/examples/wasm2cstruct/README.md index 9ebe0fba..3238fdf0 100644 --- a/examples/wasm2cstruct/README.md +++ b/examples/wasm2cstruct/README.md @@ -29,13 +29,19 @@ the generated C source file. [runwasi_cstruct]: ../runwasi_cstruct +## Notes + * This effectively preloads a module at the build-time of the embedder. * The generated structure and its all dependencies are `const` qualified. - The compiler likely places them into a read-only sections. + The compiler likely places them into read-only sections. * While it's less flexible than dynamically loading modules using - the `module_create` API, it's likely more memory-efficient. - More importantly, the loaded modules can be placed on the ROM directly. + the `module_create` API, it's likely more memory-efficient + especially when you want to save the malloc'ed memory. + More importantly, this can allow placing the loaded modules into + the ROM directly. * You can't use `module_destroy` on the generated structure. + +* Maybe it makes sense to use this for modules like libc.so.