Movatterモバイル変換


[0]ホーム

URL:


allocation/

directory
v1.10.1Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2025 License:Apache-2.0

Details

Repository

github.com/tetratelabs/wazero

Links

README

Allocation examples

The examples in this directory deal with memory allocation concerns inWebAssembly, e.g. How to pass strings in and out of WebAssembly functions.

$ go run greet.go wazerowasm >> Hello, wazero!go >> Hello, wazero!

While the below examples use strings, they are written in a way that would workfor binary serialization.

  • Rust - Calls Wasm built withcargo build --release --target wasm32-unknown-unknown
  • TinyGo - Calls Wasm built withtinygo build -o X.wasm -scheduler=none --no-debug -target=wasi X.go
  • Zig - Calls Wasm built withzig build

Note: Each of the above languages differ in both terms of exports and runtimebehavior around allocation, because there is no WebAssembly specification forit. For example, TinyGo exports allocation functions while Rust and Zig don't.Also, Rust eagerly collects memory before returning from a Wasm function while TinyGodoes not.

We still try to keep the examples as close to the same as possible, andhighlight things to be aware of in the respective source and README files.

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp