aboutsummaryrefslogtreecommitdiff
path: root/lib/std/heap.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-07 18:52:09 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-08 15:57:25 -0500
commitaa0daea5415dd2a20e4d7c2fd047b7bcee6c9ea4 (patch)
treeb8634d38380eb6fd32ca614678785f36167ca7b2 /lib/std/heap.zig
parenta2acc2787242fdee189ec4197c0dd847b8245139 (diff)
downloadzig-aa0daea5415dd2a20e4d7c2fd047b7bcee6c9ea4.tar.gz
zig-aa0daea5415dd2a20e4d7c2fd047b7bcee6c9ea4.zip
update more of the std lib to use `@as`
Diffstat (limited to 'lib/std/heap.zig')
-rw-r--r--lib/std/heap.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/heap.zig b/lib/std/heap.zig
index c9e9e3533d..24ab395734 100644
--- a/lib/std/heap.zig
+++ b/lib/std/heap.zig
@@ -893,10 +893,10 @@ fn testAllocatorLargeAlignment(allocator: *mem.Allocator) mem.Allocator.Error!vo
if (mem.page_size << 2 > maxInt(usize)) return;
const USizeShift = @IntType(false, std.math.log2(usize.bit_count));
- const large_align = u29(mem.page_size << 2);
+ const large_align = @as(u29, mem.page_size << 2);
var align_mask: usize = undefined;
- _ = @shlWithOverflow(usize, ~@as(usize, 0), USizeShift(@ctz(u29, large_align)), &align_mask);
+ _ = @shlWithOverflow(usize, ~@as(usize, 0), @as(USizeShift, @ctz(u29, large_align)), &align_mask);
var slice = try allocator.alignedAlloc(u8, large_align, 500);
testing.expect(@ptrToInt(slice.ptr) & align_mask == @ptrToInt(slice.ptr));