提交 6019f6de 编写于 作者: 3 3dgen

临时增加*T => ptr

上级 64315c08
# Pkg: _examples/brainfuck
TODO
// 版权 @2019 凹语言 作者。保留所有权利。
import "runtime"
func main() {
var i i32
var j []u8
println(runtime.I32_ref_to_ptr(&i))
println(runtime.U8_slice_to_ptr(j))
j = append(j, 33)
println(runtime.U8_slice_to_ptr(j))
}
{
"name": "_examples/reftoptr",
"pkgpath": "reftoptr",
"version": "0.0.1",
"authors": ["author", "author2"],
"description": "module description",
"readme": "README.md",
"homepage": "",
"repository": "",
"license": "",
"license_file": "",
"keywords": [],
"categories": []
}
......@@ -289,6 +289,14 @@ const modBaseWat_wa = `
end ;;ref_count == 0
)
(func $$wa.RT.i32_ref_to_ptr (param $b i32) (param $d i32) (result i32) ;;result = ptr
local.get $d
)
(func $$wa.RT.slice_to_ptr (param $b i32) (param $d i32) (param $l i32) (param $c i32) (result i32) ;;result = ptr
local.get $d
)
`
const modBaseWat_wasi = `
......
......@@ -142,3 +142,9 @@ func free(ap: u32) {
knr_freep = p_addr
}
#wa:linkname $wa.RT.i32_ref_to_ptr
func I32_ref_to_ptr(t *i32) u32
#wa:linkname $wa.RT.slice_to_ptr
func U8_slice_to_ptr(t []u8) u32
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册