cr suggestions

This commit is contained in:
TianlongLiang 2026-03-26 17:16:59 +08:00
parent c5ee306f2c
commit 435f4c151f
5 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# Samples
- [**basic**](./basic): Demonstrating how to use runtime exposed API's to call WASM functions, how to register native functions and call them, and how to call WASM function from native function.
- [**custom_section**](./custom_section): Demonstrating how to embed a binary payload into a Wasm custom section, resolve it from native code with `wasm_runtime_get_custom_section`, and print it later through a handle-based native API.
- [**custom-section**](./custom-section): Demonstrating how to embed a binary payload into a Wasm custom section, resolve it from native code with `wasm_runtime_get_custom_section`, and print it later through a handle-based native API.
- **[file](./file/README.md)**: Demonstrating the supported file interaction API of WASI. This sample can also demonstrate the SGX IPFS (Intel Protected File System), enabling an enclave to seal and unseal data at rest.
- **[multi-thread](./multi-thread/)**: Demonstrating how to run wasm application which creates multiple threads to execute wasm functions concurrently, and uses mutex/cond by calling pthread related API's.
- **[spawn-thread](./spawn-thread)**: Demonstrating how to execute wasm functions of the same wasm application concurrently, in threads created by host embedder or runtime, but not the wasm application itself.

View File

@ -39,7 +39,6 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
set(WAMR_BUILD_MEMORY_PROFILING 1)
set(WAMR_BUILD_INTERP 1)
set(WAMR_BUILD_AOT 1)
set(WAMR_BUILD_JIT 0)

View File

@ -1,8 +1,8 @@
---
description: "The related code/working directory of this example resides in directory {WAMR_DIR}/samples/custom_section"
description: "The related code/working directory of this example resides in directory {WAMR_DIR}/samples/custom-section"
---
# The "custom_section" sample project
# The "custom-section" sample project
This sample demonstrates how to:

View File

@ -26,11 +26,11 @@ fi
rm -rf ${OUT_DIR}
mkdir -p ${OUT_DIR}/wasm-apps
printf '##################### build custom_section project\n'
printf '##################### build custom-section project\n'
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j ${nproc}
make -j 4
cp -a custom_section ${OUT_DIR}
printf '\n##################### build wasm app\n'

View File

@ -2,4 +2,4 @@ This payload lives in a Wasm custom section.
It is linked by custom_section_payload.s with .incbin.
The payload is read by custom_section.c, which is compiled to a Wasm module and executed by the host embedder.
It can be arbitrarily data, and the host can resolve it with `wasm_runtime_get_custom_section` and print/use it later through a handle-based native API.
It can be arbitrary data, and the host can resolve it with `wasm_runtime_get_custom_section` and print/use it later through a handle-based native API.