| ... | ... | @@ -294,10 +294,10 @@ pub fn allocAdvancedWithRetAddr( |
| 294 | 294 | // TODO The `if (alignment == null)` blocks are workarounds for zig not being able to |
| 295 | 295 | // access certain type information about T without creating a circular dependency in async |
| 296 | 296 | // functions that heap-allocate their own frame with @Frame(func). |
| 297 | | const size_of_T = if (alignment == null) @intCast(u29, @divExact(byte_count, n)) else @sizeOf(T); |
| 297 | const size_of_T: usize = if (alignment == null) @divExact(byte_count, n) else @sizeOf(T); |
| 298 | 298 | const len_align: u29 = switch (exact) { |
| 299 | 299 | .exact => 0, |
| 300 | | .at_least => size_of_T, |
| 300 | .at_least => math.cast(u29, size_of_T) orelse 0, |
| 301 | 301 | }; |
| 302 | 302 | const byte_slice = try self.rawAlloc(byte_count, a, len_align, return_address); |
| 303 | 303 | switch (exact) { |
| ... | ... | @@ -393,7 +393,7 @@ pub fn reallocAdvancedWithRetAddr( |
| 393 | 393 | // Note: can't set shrunk memory to undefined as memory shouldn't be modified on realloc failure |
| 394 | 394 | const len_align: u29 = switch (exact) { |
| 395 | 395 | .exact => 0, |
| 396 | | .at_least => @sizeOf(T), |
| 396 | .at_least => math.cast(u29, @as(usize, @sizeOf(T))) orelse 0, |
| 397 | 397 | }; |
| 398 | 398 | |
| 399 | 399 | if (mem.isAligned(@ptrToInt(old_byte_slice.ptr), new_alignment)) { |