This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/samples/workload
Wenyong Huang a5188f5574
Add checks to avoid wasm_runtime_malloc memory with size 0 (#507)
In some platforms, allocating memory with size 0 may return NULL but not an empty memory block, which causes runtime load, instantiate or execute wasm/aot file failed. We add checks to try to avoid allocating memory in runtime if the size is 0. And in wasm_runtime_malloc/free, output warning if allocate memory with size 0 and free memory with NULL ptr.
Also fix some coding style issues, fix handle riscv32 ilp32d issue, and fix several wasm-c-api issues.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-01-28 16:16:02 +08:00
..
bwa Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
docker Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
meshoptimizer Add checks to avoid wasm_runtime_malloc memory with size 0 (#507) 2021-01-28 16:16:02 +08:00
tensorflow Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
wasm-av1 Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
XNNPACK Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
preparation.sh Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00
README.md Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484) 2020-12-29 14:41:09 +08:00

All workloads have similar requirment of software dependencies, including wasi-sdk, emsdk, wabt and binaryen

There might be slight differences when using MacOS and other Linux distro than Ubuntu. This document only target Ubuntu 18.04 as example.

Installation instructions

use preparation.sh to install all dependencies before compiling any workload.

for details, the script includes below steps:

  • wasi-sdk. Install latest release to /opt/wasi-sdk

  • wabt. Install latest release to /opt/wabt or /opt/wabt-1.0.20

  • emsdk. Refer to the guide. Don't forget to activate emsdk and set up environment variables. Verify it with echo ${EMSDK}.

  • binaryen. Install latest release to /opt/binaryen or /opt/binaryen-version_97