mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 15:12:31 +00:00
Fix index calculation in WasmPageAllocator
This commit is contained in:
parent
8a4bcc4ec3
commit
04c182274c
@ -37,7 +37,7 @@ const FreeBlock = struct {
|
||||
}
|
||||
|
||||
fn getBit(self: FreeBlock, idx: usize) PageStatus {
|
||||
const bit = mem.readPackedInt(u1, mem.sliceAsBytes(self.data), 8 * idx, .little);
|
||||
const bit = mem.readPackedInt(u1, mem.sliceAsBytes(self.data), idx, .little);
|
||||
return @as(PageStatus, @enumFromInt(bit));
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ const FreeBlock = struct {
|
||||
var i: usize = 0;
|
||||
const bytes = mem.sliceAsBytes(self.data);
|
||||
while (i < len) : (i += 1) {
|
||||
mem.writePackedInt(u1, bytes, 8 * (start_idx + i), @intFromEnum(val), .little);
|
||||
mem.writePackedInt(u1, bytes, start_idx + i, @intFromEnum(val), .little);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user