diff --git a/README.mbt.md b/README.mbt.md index d02c831..dd25286 100644 --- a/README.mbt.md +++ b/README.mbt.md @@ -9,6 +9,11 @@ Use it when you want a MoonBit executable that runs cleanly under `moon run`, `wasmtime`, or another WASIp1 host without tying your code to host-specific file and terminal APIs. +## ABI compatibility + +0.1.0 is compatible with MoonBit < 0.9.3 +0.2.0 is compatible with MoonBit >= 0.9.3 + ## Public API - `args_get()` diff --git a/internal/ffi/top.mbt b/internal/ffi/top.mbt index 4987450..cbb4783 100644 --- a/internal/ffi/top.mbt +++ b/internal/ffi/top.mbt @@ -39,14 +39,14 @@ pub fn malloc(size : Int) -> Int { ///| pub extern "wasm" fn free(position : Int) = - #|(func (param i32) local.get 0 i32.const 8 i32.sub call $moonbit.decref) + #|(func (param i32) local.get 0 call $moonbit.decref) ///| #owned(bytes) pub extern "wasm" fn byte_array2ptr(bytes : FixedArray[Byte]) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.const 8 i32.add) + #|(func (param i32) (result i32) local.get 0) ///| #owned(bytes) pub extern "wasm" fn bytes2ptr(bytes : Bytes) -> Int = - #|(func (param i32) (result i32) local.get 0 i32.const 8 i32.add) + #|(func (param i32) (result i32) local.get 0) diff --git a/moon.mod.json b/moon.mod.json index b2cc3d5..bc8d357 100644 --- a/moon.mod.json +++ b/moon.mod.json @@ -1,6 +1,6 @@ { "name": "moonbit-community/miniio", - "version": "0.1.0", + "version": "0.2.0", "description": "Small, portable WASIp1 I/O SDK for building MoonBit CLI tools and agent skills.", "keywords": ["wasi", "wasip1", "io", "cli", "agent"], "readme": "README.md",