diff options
Diffstat (limited to 'src/lib/mem.zig')
-rw-r--r-- | src/lib/mem.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/mem.zig b/src/lib/mem.zig index 5ec99ab..eefa452 100644 --- a/src/lib/mem.zig +++ b/src/lib/mem.zig @@ -2,12 +2,12 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -const paging = @import("paging.zig"); const std = @import("std"); +const paging = @import("paging.zig"); const Allocator = std.mem.Allocator; -const mem = std.mem; -const maxInt = std.math.maxInt; const assert = std.debug.assert; +const maxInt = std.math.maxInt; +const mem = std.mem; const Chunk = struct { flags: Flags, @@ -61,7 +61,7 @@ pub fn ChunkAllocator(comptime config: ChunkAllocatorConfig) type { } } - pub fn allocator(self: *Self) mem.Allocator { + pub fn allocator(self: *Self) Allocator { return .{ .ptr = self, .vtable = &.{ @@ -77,7 +77,7 @@ pub fn ChunkAllocator(comptime config: ChunkAllocatorConfig) type { const self: *Self = @ptrCast(@alignCast(ctx)); - const ptr_align = @as(usize, 1) << @as(mem.Allocator.Log2Align, @intCast(log2_ptr_align)); + const ptr_align = @as(usize, 1) << @as(Allocator.Log2Align, @intCast(log2_ptr_align)); var chunk = self.head orelse return null; const bound = @intFromPtr(chunk) + (self.pages * paging.page_size); @@ -124,7 +124,7 @@ pub fn ChunkAllocator(comptime config: ChunkAllocatorConfig) type { const self: *Self = @ptrCast(@alignCast(ctx)); - const ptr_align = @as(usize, 1) << @as(mem.Allocator.Log2Align, @intCast(log2_buf_align)); + const ptr_align = @as(usize, 1) << @as(Allocator.Log2Align, @intCast(log2_buf_align)); const head = self.head orelse return false; const bound = @intFromPtr(head) + (self.pages * paging.page_size); |