mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
cr suggestions
This commit is contained in:
parent
c5ee306f2c
commit
435f4c151f
|
|
@ -1,7 +1,7 @@
|
||||||
# Samples
|
# 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.
|
- [**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.
|
- **[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.
|
- **[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.
|
- **[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.
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(WAMR_BUILD_MEMORY_PROFILING 1)
|
|
||||||
set(WAMR_BUILD_INTERP 1)
|
set(WAMR_BUILD_INTERP 1)
|
||||||
set(WAMR_BUILD_AOT 1)
|
set(WAMR_BUILD_AOT 1)
|
||||||
set(WAMR_BUILD_JIT 0)
|
set(WAMR_BUILD_JIT 0)
|
||||||
|
|
|
||||||
|
|
@ -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:
|
This sample demonstrates how to:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,11 @@ fi
|
||||||
rm -rf ${OUT_DIR}
|
rm -rf ${OUT_DIR}
|
||||||
mkdir -p ${OUT_DIR}/wasm-apps
|
mkdir -p ${OUT_DIR}/wasm-apps
|
||||||
|
|
||||||
printf '##################### build custom_section project\n'
|
printf '##################### build custom-section project\n'
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
cmake .. -DCMAKE_BUILD_TYPE=Debug
|
||||||
make -j ${nproc}
|
make -j 4
|
||||||
cp -a custom_section ${OUT_DIR}
|
cp -a custom_section ${OUT_DIR}
|
||||||
|
|
||||||
printf '\n##################### build wasm app\n'
|
printf '\n##################### build wasm app\n'
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,4 @@ This payload lives in a Wasm custom section.
|
||||||
It is linked by custom_section_payload.s with .incbin.
|
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.
|
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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user