make sure to check raw capacity when decrementing refcounts

This commit is contained in:
Brendan Hansknecht 2023-03-12 14:40:04 -07:00
parent 5d87ba3441
commit b94a046b0d
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
3 changed files with 15 additions and 14 deletions

View file

@ -112,7 +112,8 @@ pub const RocList = extern struct {
}
pub fn decref(self: RocList, alignment: u32) void {
utils.decref(self.getRefcountPtr(), self.getCapacity(), alignment);
// We use the raw capacity to ensure we always decrement the refcount of seamless slices.
utils.decref(self.getRefcountPtr(), self.capacity_or_ref_ptr, alignment);
}
pub fn elements(self: RocList, comptime T: type) ?[*]T {