File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -126,14 +126,14 @@ pub fn SbrkAllocator(comptime sbrk: *const fn (n: usize) usize) type {
126
126
const class = math .log2 (slot_size ) - min_class ;
127
127
const addr = @intFromPtr (buf .ptr );
128
128
if (class < size_class_count ) {
129
- const node = @as ( * usize , @ptrFromInt ( addr + ( slot_size - @sizeOf (usize ) )));
129
+ const node : * usize = @ptrCast ( @alignCast ( buf . ptr + slot_size - @sizeOf (usize )));
130
130
node .* = frees [class ];
131
131
frees [class ] = addr ;
132
132
} else {
133
133
const bigpages_needed = bigPagesNeeded (actual_len );
134
134
const pow2_pages = math .ceilPowerOfTwoAssert (usize , bigpages_needed );
135
135
const big_slot_size_bytes = pow2_pages * bigpage_size ;
136
- const node = @as ( * usize , @ptrFromInt ( addr + ( big_slot_size_bytes - @sizeOf (usize ) )));
136
+ const node : * usize = @ptrCast ( @alignCast ( buf . ptr + big_slot_size_bytes - @sizeOf (usize )));
137
137
const big_class = math .log2 (pow2_pages );
138
138
node .* = big_frees [big_class ];
139
139
big_frees [big_class ] = addr ;
You can’t perform that action at this time.
0 commit comments