mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
fix bug in realloc on 32-bit platforms
This commit is contained in:
parent
aaed62dad3
commit
3adfbf3459
1 changed files with 1 additions and 7 deletions
|
@ -208,13 +208,7 @@ pub fn unsafeReallocate(
|
|||
new_length: usize,
|
||||
element_width: usize,
|
||||
) [*]u8 {
|
||||
const align_width: usize = blk: {
|
||||
if (alignment > 8) {
|
||||
break :blk (2 * @sizeOf(usize));
|
||||
} else {
|
||||
break :blk @sizeOf(usize);
|
||||
}
|
||||
};
|
||||
const align_width: usize = std.math.max(alignment, @sizeOf(usize));
|
||||
|
||||
const old_width = align_width + old_length * element_width;
|
||||
const new_width = align_width + new_length * element_width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue