| ... | ... | @@ -326,9 +326,6 @@ pub fn resize(self: Allocator, allocation: anytype, new_len: usize) bool { |
| 326 | 326 | return false; |
| 327 | 327 | } |
| 328 | 328 | const old_memory: []u8 = @ptrCast(@constCast(mem.absorbSentinel(allocation))); |
| 329 | | // I would like to use saturating multiplication here, but LLVM cannot lower it |
| 330 | | // on WebAssembly: https://github.com/ziglang/zig/issues/9660 |
| 331 | | //const new_len_bytes = new_len *| @sizeOf(T); |
| 332 | 329 | const new_len_bytes = math.mul(usize, @sizeOf(T), new_len) catch return false; |
| 333 | 330 | return self.rawResize( |
| 334 | 331 | old_memory, |
| ... | ... | @@ -372,9 +369,6 @@ pub fn remap(self: Allocator, allocation: anytype, new_len: usize) ?@TypeOf(allo |
| 372 | 369 | return new_memory; |
| 373 | 370 | } |
| 374 | 371 | const old_memory: []u8 = @ptrCast(@constCast(mem.absorbSentinel(allocation))); |
| 375 | | // I would like to use saturating multiplication here, but LLVM cannot lower it |
| 376 | | // on WebAssembly: https://github.com/ziglang/zig/issues/9660 |
| 377 | | //const new_len_bytes = new_len *| @sizeOf(T); |
| 378 | 372 | const new_len_bytes = math.mul(usize, @sizeOf(T), new_len) catch return null; |
| 379 | 373 | const new_ptr = self.rawRemap( |
| 380 | 374 | old_memory, |