mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-10 10:02:38 +03:00
fix bug in realloc on 32-bit platforms
This commit is contained in:
parent
aaed62dad3
commit
3adfbf3459
@ -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…
Reference in New Issue
Block a user