Skip to content

Commit

Permalink
Add back comptime check for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Feng committed Dec 6, 2019
1 parent 5a004ed commit c12b5cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/std/heap.zig
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ extern fn @"llvm.wasm.memory.size.i32"(u32) u32;
extern fn @"llvm.wasm.memory.grow.i32"(u32, u32) i32;

const WasmPageAllocator = struct {
comptime {
if (!std.Target.current.isWasm()) {
@compileError("WasmPageAllocator is only available for wasm32 arch");
}
}

const PageStatus = enum(u1) {
used = 0,
free = 1,
Expand Down

0 comments on commit c12b5cb

Please sign in to comment.