mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
More precise alignCast (allow for 32-bit targets)
This commit is contained in:
parent
457041a314
commit
3c74acafa4
4 changed files with 7 additions and 7 deletions
|
@ -36,7 +36,7 @@ pub const RocList = extern struct {
|
|||
}
|
||||
|
||||
// otherwise, check if the refcount is one
|
||||
const ptr: [*]usize = @ptrCast([*]usize, @alignCast(8, self.bytes));
|
||||
const ptr: [*]usize = @ptrCast([*]usize, @alignCast(@alignOf(usize), self.bytes));
|
||||
return (ptr - 1)[0] == utils.REFCOUNT_ONE;
|
||||
}
|
||||
|
||||
|
@ -1282,7 +1282,7 @@ pub fn listSet(
|
|||
// `if inBounds then LowLevelListGet input index item else input`
|
||||
// so we don't do a bounds check here. Hence, the list is also non-empty,
|
||||
// because inserting into an empty list is always out of bounds
|
||||
const ptr: [*]usize = @ptrCast([*]usize, @alignCast(8, bytes));
|
||||
const ptr: [*]usize = @ptrCast([*]usize, @alignCast(@alignOf(usize), bytes));
|
||||
|
||||
if ((ptr - 1)[0] == utils.REFCOUNT_ONE) {
|
||||
return listSetInPlaceHelp(bytes, index, element, element_width, dec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue