InternPool: implement and use thread-safe list for strings

This commit is contained in:
Jacob Young
2024-07-03 22:37:09 -04:00
parent 3e1b190fe6
commit 8293ff94cf
6 changed files with 388 additions and 165 deletions

View File

@@ -534,7 +534,7 @@ pub fn MultiArrayList(comptime T: type) type {
self.sortInternal(a, b, ctx, .unstable);
}
fn capacityInBytes(capacity: usize) usize {
pub fn capacityInBytes(capacity: usize) usize {
comptime var elem_bytes: usize = 0;
inline for (sizes.bytes) |size| elem_bytes += size;
return elem_bytes * capacity;