aboutsummaryrefslogtreecommitdiff
path: root/wasm/malloc_wasip1.go
diff options
context:
space:
mode:
Diffstat (limited to 'wasm/malloc_wasip1.go')
-rw-r--r--wasm/malloc_wasip1.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/wasm/malloc_wasip1.go b/wasm/malloc_wasip1.go
new file mode 100644
index 0000000..d7bb0a6
--- /dev/null
+++ b/wasm/malloc_wasip1.go
@@ -0,0 +1,6 @@
+package wasm
+
+//go:wasmexport malloc
+func Malloc(size uint32) Buffer {
+ return FromSlice(make([]byte, size))
+}