Fix incref

This commit is contained in:
Richard Feldman 2025-12-07 16:44:39 -05:00
parent 172875f057
commit d9358ab13c
No known key found for this signature in database

View file

@ -973,16 +973,6 @@ pub fn listSublist(
}
}
// When the list is not unique (refcount > 1), the seamless slice needs
// its own reference to the parent allocation. The "consume" semantic
// only means the caller gives us their reference, but there are other
// holders, and the new slice is an additional reference to the allocation.
if (!list.isUnique()) {
if (list.getAllocationDataPtr()) |parent_alloc| {
increfDataPtrC(parent_alloc, 1);
}
}
return RocList{
.bytes = source_ptr + start * element_width,
.length = keep_len,