| ... | ... | @@ -257,6 +257,9 @@ test "" { |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | const WasmPageAllocator = struct { |
| 260 | // TODO: figure out why __heap_base cannot be found |
| 261 | var heap_base_wannabe: [256]u8 = undefined; |
| 262 | |
| 260 | 263 | const FreeBlock = struct { |
| 261 | 264 | offset: usize = 0, |
| 262 | 265 | packed_data: std.PackedIntSlice(u1) = std.PackedIntSlice(u1).init(&[_]u8{}, 0), |
| ... | ... | @@ -349,7 +352,8 @@ const WasmPageAllocator = struct { |
| 349 | 352 | |
| 350 | 353 | if (free_end > free_start) { |
| 351 | 354 | if (conventional.totalPages() == 0) { |
| 352 | | conventional.initData(__heap_base[0..@intCast(usize, @"llvm.wasm.memory.size.i32"(0) * std.mem.page_size)]); |
| 355 | //conventional.initData(__heap_base[0..@intCast(usize, @"llvm.wasm.memory.size.i32"(0) * std.mem.page_size)]); |
| 356 | conventional.initData(heap_base_wannabe[0..]); |
| 353 | 357 | } |
| 354 | 358 | |
| 355 | 359 | if (free_start < conventional.totalPages()) { |