diff options
Diffstat (limited to 'src/memory_allocator.zig')
-rw-r--r-- | src/memory_allocator.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/memory_allocator.zig b/src/memory_allocator.zig index 391446f5e..dbcc492e9 100644 --- a/src/memory_allocator.zig +++ b/src/memory_allocator.zig @@ -71,7 +71,7 @@ const CAllocator = struct { } } - return @ptrCast(?[*]u8, ptr); + return @as(?[*]u8, @ptrCast(ptr)); } fn alignedAllocSize(ptr: [*]u8) usize { @@ -83,7 +83,7 @@ const CAllocator = struct { return alignedAlloc(len, log2_align); } - const alignment = @as(usize, 1) << @intCast(Allocator.Log2Align, log2_align); + const alignment = @as(usize, 1) << @as(Allocator.Log2Align, @intCast(log2_align)); return alignedAlloc(len, alignment); } @@ -132,7 +132,7 @@ const ZAllocator = struct { } } - return @ptrCast(?[*]u8, ptr); + return @as(?[*]u8, @ptrCast(ptr)); } fn alignedAllocSize(ptr: [*]u8) usize { @@ -211,7 +211,7 @@ const HugeAllocator = struct { _: u29, _: usize, ) void { - std.os.munmap(@alignCast(std.meta.alignment([]align(std.mem.page_size) u8), buf)); + std.os.munmap(@alignCast(buf)); } }; |