From 435f4c151f4dc9056d875ff25a1c90100bd17d81 Mon Sep 17 00:00:00 2001 From: TianlongLiang Date: Thu, 26 Mar 2026 17:16:59 +0800 Subject: [PATCH] cr suggestions --- samples/README.md | 2 +- samples/custom-section/CMakeLists.txt | 1 - samples/custom-section/README.md | 4 ++-- samples/custom-section/build.sh | 4 ++-- samples/custom-section/wasm-apps/custom_section_payload.bin | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/samples/README.md b/samples/README.md index f190cd222..a139dcbf2 100644 --- a/samples/README.md +++ b/samples/README.md @@ -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. diff --git a/samples/custom-section/CMakeLists.txt b/samples/custom-section/CMakeLists.txt index 0387dcf4f..1a0a94d44 100644 --- a/samples/custom-section/CMakeLists.txt +++ b/samples/custom-section/CMakeLists.txt @@ -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) diff --git a/samples/custom-section/README.md b/samples/custom-section/README.md index 5063bd130..63dff44bf 100644 --- a/samples/custom-section/README.md +++ b/samples/custom-section/README.md @@ -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: diff --git a/samples/custom-section/build.sh b/samples/custom-section/build.sh index ff8a40aa3..4b4835b1d 100755 --- a/samples/custom-section/build.sh +++ b/samples/custom-section/build.sh @@ -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' diff --git a/samples/custom-section/wasm-apps/custom_section_payload.bin b/samples/custom-section/wasm-apps/custom_section_payload.bin index 89f178549..4693af512 100644 --- a/samples/custom-section/wasm-apps/custom_section_payload.bin +++ b/samples/custom-section/wasm-apps/custom_section_payload.bin @@ -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.