Link globals into global scope instead

This commit is contained in:
dcodeIO
2017-12-16 20:08:33 +01:00
parent 2720515982
commit c70eb7792f
5 changed files with 72 additions and 37 deletions

View File

@ -8,7 +8,7 @@
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $Heap.allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
(func $heap/Heap.allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(if
@ -97,7 +97,7 @@
)
(get_local $1)
)
(func $Heap.dispose (; 1 ;) (type $iv) (param $0 i32)
(func $heap/Heap.dispose (; 1 ;) (type $iv) (param $0 i32)
(nop)
)
(func $start (; 2 ;) (type $v)
@ -105,11 +105,11 @@
(get_global $HEAP_BASE)
)
(set_global $std/heap/ptr
(call $Heap.allocate
(call $heap/Heap.allocate
(i32.const 10)
)
)
(call $Heap.dispose
(call $heap/Heap.dispose
(get_global $std/heap/ptr)
)
)