runtime: precisely scan globals on all platforms

This commit is contained in:
Jake Bailey
2026-08-07 12:08:32 -07:00
committed by Ron Evans
parent ede501ae2b
commit 59fb104004
18 changed files with 136 additions and 324 deletions
+20
View File
@@ -0,0 +1,20 @@
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-wasm"
@allocFunction = constant ptr @runtime.alloc
declare ptr @runtime.alloc(i32, ptr)
declare void @use(ptr)
define void @passAllocator() {
entry:
call void @use(ptr @runtime.alloc)
ret void
}
define ptr @allocate() {
entry:
%allocation = call ptr @runtime.alloc(i32 4, ptr inttoptr (i32 5 to ptr))
ret ptr %allocation
}