From f32555aa087f69e1d2f4c214b180d945cca9f37b Mon Sep 17 00:00:00 2001 From: Benjamin Feng Date: Wed, 27 Nov 2019 22:14:16 -0600 Subject: [PATCH] Work around __heap_base for now --- lib/std/heap.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 5e1fc92068..8f451ea3cb 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -257,6 +257,9 @@ test "" { } const WasmPageAllocator = struct { + // TODO: figure out why __heap_base cannot be found + var heap_base_wannabe: [256]u8 = undefined; + const FreeBlock = struct { offset: usize = 0, packed_data: std.PackedIntSlice(u1) = std.PackedIntSlice(u1).init(&[_]u8{}, 0), @@ -349,7 +352,8 @@ const WasmPageAllocator = struct { if (free_end > free_start) { if (conventional.totalPages() == 0) { - conventional.initData(__heap_base[0..@intCast(usize, @"llvm.wasm.memory.size.i32"(0) * std.mem.page_size)]); + //conventional.initData(__heap_base[0..@intCast(usize, @"llvm.wasm.memory.size.i32"(0) * std.mem.page_size)]); + conventional.initData(heap_base_wannabe[0..]); } if (free_start < conventional.totalPages()) {