also update is_unique for atomic isize

This commit is contained in:
Brendan Hansknecht 2024-12-31 16:03:52 -08:00
parent f901946455
commit 8ad6c47211
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -433,7 +433,17 @@ pub fn isUnique(
std.debug.print("| is unique {*}\n", .{isizes - 1});
}
return refcount == REFCOUNT_ONE_ISIZE;
switch (RC_TYPE) {
.normal => {
return refcount == REFCOUNT_ONE_ISIZE;
},
.atomic => {
return refcount == REFCOUNT_ONE_ISIZE or refcount == REFCOUNT_ONE_ATOMIC_ISIZE;
},
.none => {
return false;
},
}
}
// We follow roughly the [fbvector](https://github.com/facebook/folly/blob/main/folly/docs/FBVector.md) when it comes to growing a RocList.