mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-23 20:12:27 +00:00
use capacity instead of length in list deinit
This commit is contained in:
parent
b8a6e05ed9
commit
4e5b106f98
3 changed files with 40 additions and 9 deletions
|
@ -324,6 +324,10 @@ pub const RocStr = extern struct {
|
|||
}
|
||||
|
||||
fn refcountMachine(self: RocStr) usize {
|
||||
if (self.getCapacity() == 0 or self.isSmallStr()) {
|
||||
return utils.REFCOUNT_ONE;
|
||||
}
|
||||
|
||||
const ptr: [*]usize = @ptrCast([*]usize, @alignCast(@alignOf(usize), self.str_bytes));
|
||||
return (ptr - 1)[0];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue