Skip to content

Commit 5c09fb0

Browse files
committed
x/cabi: improve Go package documentation
1 parent 80d210d commit 5c09fb0

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

x/cabi/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

x/cabi/docs.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Package cabi contains a single WebAssembly function exported as cabi_realloc.
2+
//
3+
// To use, import this package with _:
4+
//
5+
// import _ "go.bytecodealliance.org/x/cabi"
6+
//
7+
// Function realloc is a WebAssembly [core function] that is validated to have the following core function type:
8+
//
9+
// (func (param $originalPtr i32)
10+
// (param $originalSize i32)
11+
// (param $alignment i32)
12+
// (param $newSize i32)
13+
// (result i32))
14+
//
15+
// The [Canonical ABI] will use realloc both to allocate (passing 0 for the first two parameters) and reallocate. If the Canonical ABI needs realloc, validation requires this option to be present (there is no default).
16+
//
17+
// [core function]: https://www.w3.org/TR/wasm-core-2/syntax/modules.html#functions
18+
// [Canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
19+
package cabi

0 commit comments

Comments
 (0)