diff options
| author | xackus <14938807+xackus@users.noreply.github.com> | 2020-02-21 19:46:53 +0100 |
|---|---|---|
| committer | xackus <14938807+xackus@users.noreply.github.com> | 2020-02-21 19:46:53 +0100 |
| commit | 783e8ad0319b950a1d42d5a93e4fbb9e9df1be10 (patch) | |
| tree | 81b12200e10eb03167c48a7115edca5d6dbac4e4 /lib/std/heap.zig | |
| parent | fdae5f5a07c043d9eeefe4933bcfbd03df581fde (diff) | |
| download | zig-783e8ad0319b950a1d42d5a93e4fbb9e9df1be10.tar.gz zig-783e8ad0319b950a1d42d5a93e4fbb9e9df1be10.zip | |
remove @bytesToSlice, @sliceToBytes from std lib
Diffstat (limited to 'lib/std/heap.zig')
| -rw-r--r-- | lib/std/heap.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 1bce45081d..135d7297a2 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -283,14 +283,14 @@ const WasmPageAllocator = struct { fn getBit(self: FreeBlock, idx: usize) PageStatus { const bit_offset = 0; - return @intToEnum(PageStatus, Io.get(@sliceToBytes(self.data), idx, bit_offset)); + return @intToEnum(PageStatus, Io.get(mem.sliceAsBytes(self.data), idx, bit_offset)); } fn setBits(self: FreeBlock, start_idx: usize, len: usize, val: PageStatus) void { const bit_offset = 0; var i: usize = 0; while (i < len) : (i += 1) { - Io.set(@sliceToBytes(self.data), start_idx + i, bit_offset, @enumToInt(val)); + Io.set(mem.sliceAsBytes(self.data), start_idx + i, bit_offset, @enumToInt(val)); } } @@ -552,7 +552,7 @@ pub const ArenaAllocator = struct { if (len >= actual_min_size) break; } const buf = try self.child_allocator.alignedAlloc(u8, @alignOf(BufNode), len); - const buf_node_slice = @bytesToSlice(BufNode, buf[0..@sizeOf(BufNode)]); + const buf_node_slice = mem.bytesAsSlice(BufNode, buf[0..@sizeOf(BufNode)]); const buf_node = &buf_node_slice[0]; buf_node.* = BufNode{ .data = buf, |
