| ... | ... | @@ -182,7 +182,7 @@ pub const TrackedInst = extern struct { |
| 182 | 182 | pub fn wrap(unwrapped: Unwrapped, ip: *const InternPool) TrackedInst.Index { |
| 183 | 183 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 184 | 184 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 185 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 185 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 186 | 186 | unwrapped.index); |
| 187 | 187 | } |
| 188 | 188 | }; |
| ... | ... | @@ -480,7 +480,7 @@ pub const ComptimeUnit = extern struct { |
| 480 | 480 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) ComptimeUnit.Id { |
| 481 | 481 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 482 | 482 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 483 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 483 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 484 | 484 | unwrapped.index); |
| 485 | 485 | } |
| 486 | 486 | }; |
| ... | ... | @@ -699,7 +699,7 @@ pub const Nav = struct { |
| 699 | 699 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) Nav.Index { |
| 700 | 700 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 701 | 701 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 702 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 702 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 703 | 703 | unwrapped.index); |
| 704 | 704 | } |
| 705 | 705 | }; |
| ... | ... | @@ -1047,6 +1047,7 @@ const Local = struct { |
| 1047 | 1047 | extra: ListMutate, |
| 1048 | 1048 | limbs: ListMutate, |
| 1049 | 1049 | strings: ListMutate, |
| 1050 | string_bytes: ListMutate, |
| 1050 | 1051 | tracked_insts: ListMutate, |
| 1051 | 1052 | files: ListMutate, |
| 1052 | 1053 | maps: ListMutate, |
| ... | ... | @@ -1061,6 +1062,7 @@ const Local = struct { |
| 1061 | 1062 | extra: Extra, |
| 1062 | 1063 | limbs: Limbs, |
| 1063 | 1064 | strings: Strings, |
| 1065 | string_bytes: StringBytes, |
| 1064 | 1066 | tracked_insts: TrackedInsts, |
| 1065 | 1067 | files: List(File), |
| 1066 | 1068 | maps: Maps, |
| ... | ... | @@ -1084,7 +1086,8 @@ const Local = struct { |
| 1084 | 1086 | @sizeOf(u64) => List(struct { u64 }), |
| 1085 | 1087 | else => @compileError("unsupported host"), |
| 1086 | 1088 | }; |
| 1087 | | const Strings = List(struct { u8 }); |
| 1089 | const Strings = List(struct { u32 }); |
| 1090 | const StringBytes = List(struct { u8 }); |
| 1088 | 1091 | const TrackedInsts = List(struct { TrackedInst.MaybeLost }); |
| 1089 | 1092 | const Maps = List(struct { FieldMap }); |
| 1090 | 1093 | const Navs = List(Nav.Repr); |
| ... | ... | @@ -1414,17 +1417,27 @@ const Local = struct { |
| 1414 | 1417 | }; |
| 1415 | 1418 | } |
| 1416 | 1419 | |
| 1420 | /// A list of offsets into `string_bytes` for each string. |
| 1421 | pub fn getMutableStrings(local: *Local, gpa: Allocator) Strings.Mutable { |
| 1422 | return .{ |
| 1423 | .gpa = gpa, |
| 1424 | .arena = &local.mutate.arena, |
| 1425 | .mutate = &local.mutate.strings, |
| 1426 | .list = &local.shared.strings, |
| 1427 | }; |
| 1428 | } |
| 1429 | |
| 1417 | 1430 | /// In order to store references to strings in fewer bytes, we copy all |
| 1418 | 1431 | /// string bytes into here. String bytes can be null. It is up to whomever |
| 1419 | 1432 | /// is referencing the data here whether they want to store both index and length, |
| 1420 | 1433 | /// thus allowing null bytes, or store only index, and use null-termination. The |
| 1421 | | /// `strings` array is agnostic to either usage. |
| 1422 | | pub fn getMutableStrings(local: *Local, gpa: Allocator) Strings.Mutable { |
| 1434 | /// `strings_bytes` array is agnostic to either usage. |
| 1435 | pub fn getMutableStringBytes(local: *Local, gpa: Allocator) StringBytes.Mutable { |
| 1423 | 1436 | return .{ |
| 1424 | 1437 | .gpa = gpa, |
| 1425 | 1438 | .arena = &local.mutate.arena, |
| 1426 | | .mutate = &local.mutate.strings, |
| 1427 | | .list = &local.shared.strings, |
| 1439 | .mutate = &local.mutate.string_bytes, |
| 1440 | .list = &local.shared.string_bytes, |
| 1428 | 1441 | }; |
| 1429 | 1442 | } |
| 1430 | 1443 | |
| ... | ... | @@ -1597,7 +1610,7 @@ const Shard = struct { |
| 1597 | 1610 | }; |
| 1598 | 1611 | |
| 1599 | 1612 | fn getTidMask(ip: *const InternPool) u32 { |
| 1600 | | return (@as(u32, 1) << ip.tid_width) - 1; |
| 1613 | return @shlExact(@as(u32, 1), ip.tid_width) - 1; |
| 1601 | 1614 | } |
| 1602 | 1615 | |
| 1603 | 1616 | fn getIndexMask(ip: *const InternPool, comptime BackingInt: type) u32 { |
| ... | ... | @@ -1652,7 +1665,7 @@ pub const MapIndex = enum(u32) { |
| 1652 | 1665 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) MapIndex { |
| 1653 | 1666 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 1654 | 1667 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 1655 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 1668 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 1656 | 1669 | unwrapped.index); |
| 1657 | 1670 | } |
| 1658 | 1671 | }; |
| ... | ... | @@ -1678,7 +1691,7 @@ pub const NamespaceIndex = enum(u32) { |
| 1678 | 1691 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 1679 | 1692 | assert(unwrapped.bucket_index <= ip.getIndexMask(u32) >> Local.namespaces_bucket_width); |
| 1680 | 1693 | assert(unwrapped.index <= Local.namespaces_bucket_mask); |
| 1681 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 1694 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 1682 | 1695 | unwrapped.bucket_index << Local.namespaces_bucket_width | |
| 1683 | 1696 | unwrapped.index); |
| 1684 | 1697 | } |
| ... | ... | @@ -1721,7 +1734,7 @@ pub const FileIndex = enum(u32) { |
| 1721 | 1734 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) FileIndex { |
| 1722 | 1735 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 1723 | 1736 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 1724 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | |
| 1737 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 1725 | 1738 | unwrapped.index); |
| 1726 | 1739 | } |
| 1727 | 1740 | }; |
| ... | ... | @@ -1780,7 +1793,8 @@ pub const String = enum(u32) { |
| 1780 | 1793 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) String { |
| 1781 | 1794 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 1782 | 1795 | assert(unwrapped.index <= ip.getIndexMask(u32)); |
| 1783 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | unwrapped.index); |
| 1796 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_32) | |
| 1797 | unwrapped.index); |
| 1784 | 1798 | } |
| 1785 | 1799 | }; |
| 1786 | 1800 | fn unwrap(string: String, ip: *const InternPool) Unwrapped { |
| ... | ... | @@ -1791,9 +1805,11 @@ pub const String = enum(u32) { |
| 1791 | 1805 | } |
| 1792 | 1806 | |
| 1793 | 1807 | fn toOverlongSlice(string: String, ip: *const InternPool) []const u8 { |
| 1794 | | const unwrapped_string = string.unwrap(ip); |
| 1795 | | const strings = ip.getLocalShared(unwrapped_string.tid).strings.acquire(); |
| 1796 | | return strings.view().items(.@"0")[unwrapped_string.index..]; |
| 1808 | const unwrapped = string.unwrap(ip); |
| 1809 | const local_shared = ip.getLocalShared(unwrapped.tid); |
| 1810 | const strings = local_shared.strings.acquire().view().items(.@"0"); |
| 1811 | const string_bytes = local_shared.string_bytes.acquire().view().items(.@"0"); |
| 1812 | return string_bytes[strings[unwrapped.index]..]; |
| 1797 | 1813 | } |
| 1798 | 1814 | |
| 1799 | 1815 | const debug_state = InternPool.debug_state; |
| ... | ... | @@ -1848,12 +1864,18 @@ pub const NullTerminatedString = enum(u32) { |
| 1848 | 1864 | } |
| 1849 | 1865 | |
| 1850 | 1866 | pub fn toSlice(string: NullTerminatedString, ip: *const InternPool) [:0]const u8 { |
| 1851 | | const overlong_slice = string.toString().toOverlongSlice(ip); |
| 1852 | | return overlong_slice[0..std.mem.indexOfScalar(u8, overlong_slice, 0).? :0]; |
| 1867 | const unwrapped = string.toString().unwrap(ip); |
| 1868 | const local_shared = ip.getLocalShared(unwrapped.tid); |
| 1869 | const strings = local_shared.strings.acquire().view().items(.@"0"); |
| 1870 | const string_bytes = local_shared.string_bytes.acquire().view().items(.@"0"); |
| 1871 | return string_bytes[strings[unwrapped.index] .. strings[unwrapped.index + 1] - 1 :0]; |
| 1853 | 1872 | } |
| 1854 | 1873 | |
| 1855 | 1874 | pub fn length(string: NullTerminatedString, ip: *const InternPool) u32 { |
| 1856 | | return @intCast(string.toSlice(ip).len); |
| 1875 | const unwrapped = string.toString().unwrap(ip); |
| 1876 | const local_shared = ip.getLocalShared(unwrapped.tid); |
| 1877 | const strings = local_shared.strings.acquire().view().items(.@"0"); |
| 1878 | return strings[unwrapped.index + 1] - 1 - strings[unwrapped.index]; |
| 1857 | 1879 | } |
| 1858 | 1880 | |
| 1859 | 1881 | pub fn eqlSlice(string: NullTerminatedString, slice: []const u8, ip: *const InternPool) bool { |
| ... | ... | @@ -4767,7 +4789,8 @@ pub const Index = enum(u32) { |
| 4767 | 4789 | fn wrap(unwrapped: Unwrapped, ip: *const InternPool) Index { |
| 4768 | 4790 | assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); |
| 4769 | 4791 | assert(unwrapped.index <= ip.getIndexMask(u30)); |
| 4770 | | return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_30 | unwrapped.index); |
| 4792 | return @enumFromInt(@shlExact(@as(u32, @intFromEnum(unwrapped.tid)), ip.tid_shift_30) | |
| 4793 | unwrapped.index); |
| 4771 | 4794 | } |
| 4772 | 4795 | |
| 4773 | 4796 | pub fn getExtra(unwrapped: Unwrapped, ip: *const InternPool) Local.Extra { |
| ... | ... | @@ -6784,6 +6807,7 @@ pub fn init(ip: *InternPool, gpa: Allocator, available_threads: usize) !void { |
| 6784 | 6807 | .extra = .empty, |
| 6785 | 6808 | .limbs = .empty, |
| 6786 | 6809 | .strings = .empty, |
| 6810 | .string_bytes = .empty, |
| 6787 | 6811 | .tracked_insts = .empty, |
| 6788 | 6812 | .files = .empty, |
| 6789 | 6813 | .maps = .empty, |
| ... | ... | @@ -6799,6 +6823,7 @@ pub fn init(ip: *InternPool, gpa: Allocator, available_threads: usize) !void { |
| 6799 | 6823 | .extra = .empty, |
| 6800 | 6824 | .limbs = .empty, |
| 6801 | 6825 | .strings = .empty, |
| 6826 | .string_bytes = .empty, |
| 6802 | 6827 | .tracked_insts = .empty, |
| 6803 | 6828 | .files = .empty, |
| 6804 | 6829 | .maps = .empty, |
| ... | ... | @@ -6808,6 +6833,7 @@ pub fn init(ip: *InternPool, gpa: Allocator, available_threads: usize) !void { |
| 6808 | 6833 | .namespaces = .empty, |
| 6809 | 6834 | }, |
| 6810 | 6835 | }); |
| 6836 | for (ip.locals) |*local| try local.getMutableStrings(gpa).append(.{0}); |
| 6811 | 6837 | |
| 6812 | 6838 | ip.tid_width = @intCast(std.math.log2_int_ceil(usize, used_threads)); |
| 6813 | 6839 | ip.tid_shift_30 = if (single_threaded) 0 else 30 - ip.tid_width; |
| ... | ... | @@ -8515,30 +8541,30 @@ pub fn get(ip: *InternPool, gpa: Allocator, tid: Zcu.PerThread.Id, key: Key) All |
| 8515 | 8541 | } |
| 8516 | 8542 | |
| 8517 | 8543 | if (child == .u8_type) bytes: { |
| 8518 | | const strings = ip.getLocal(tid).getMutableStrings(gpa); |
| 8519 | | const start = strings.mutate.len; |
| 8520 | | try strings.ensureUnusedCapacity(@intCast(len_including_sentinel + 1)); |
| 8544 | const string_bytes = ip.getLocal(tid).getMutableStringBytes(gpa); |
| 8545 | const start = string_bytes.mutate.len; |
| 8546 | try string_bytes.ensureUnusedCapacity(@intCast(len_including_sentinel + 1)); |
| 8521 | 8547 | try extra.ensureUnusedCapacity(@typeInfo(Bytes).@"struct".fields.len); |
| 8522 | 8548 | switch (aggregate.storage) { |
| 8523 | | .bytes => |bytes| strings.appendSliceAssumeCapacity(.{bytes.toSlice(len, ip)}), |
| 8549 | .bytes => |bytes| string_bytes.appendSliceAssumeCapacity(.{bytes.toSlice(len, ip)}), |
| 8524 | 8550 | .elems => |elems| for (elems[0..@intCast(len)]) |elem| switch (ip.indexToKey(elem)) { |
| 8525 | 8551 | .undef => { |
| 8526 | | strings.shrinkRetainingCapacity(start); |
| 8552 | string_bytes.shrinkRetainingCapacity(start); |
| 8527 | 8553 | break :bytes; |
| 8528 | 8554 | }, |
| 8529 | | .int => |int| strings.appendAssumeCapacity(.{@intCast(int.storage.u64)}), |
| 8555 | .int => |int| string_bytes.appendAssumeCapacity(.{@intCast(int.storage.u64)}), |
| 8530 | 8556 | else => unreachable, |
| 8531 | 8557 | }, |
| 8532 | 8558 | .repeated_elem => |elem| switch (ip.indexToKey(elem)) { |
| 8533 | 8559 | .undef => break :bytes, |
| 8534 | 8560 | .int => |int| @memset( |
| 8535 | | strings.addManyAsSliceAssumeCapacity(@intCast(len))[0], |
| 8561 | string_bytes.addManyAsSliceAssumeCapacity(@intCast(len))[0], |
| 8536 | 8562 | @intCast(int.storage.u64), |
| 8537 | 8563 | ), |
| 8538 | 8564 | else => unreachable, |
| 8539 | 8565 | }, |
| 8540 | 8566 | } |
| 8541 | | if (sentinel != .none) strings.appendAssumeCapacity(.{ |
| 8567 | if (sentinel != .none) string_bytes.appendAssumeCapacity(.{ |
| 8542 | 8568 | @intCast(ip.indexToKey(sentinel).int.storage.u64), |
| 8543 | 8569 | }); |
| 8544 | 8570 | const string = try ip.getOrPutTrailingString( |
| ... | ... | @@ -11754,10 +11780,10 @@ pub fn getOrPutString( |
| 11754 | 11780 | slice: []const u8, |
| 11755 | 11781 | comptime embedded_nulls: EmbeddedNulls, |
| 11756 | 11782 | ) Allocator.Error!embedded_nulls.StringType() { |
| 11757 | | const strings = ip.getLocal(tid).getMutableStrings(gpa); |
| 11758 | | try strings.ensureUnusedCapacity(slice.len + 1); |
| 11759 | | strings.appendSliceAssumeCapacity(.{slice}); |
| 11760 | | strings.appendAssumeCapacity(.{0}); |
| 11783 | const string_bytes = ip.getLocal(tid).getMutableStringBytes(gpa); |
| 11784 | try string_bytes.ensureUnusedCapacity(slice.len + 1); |
| 11785 | string_bytes.appendSliceAssumeCapacity(.{slice}); |
| 11786 | string_bytes.appendAssumeCapacity(.{0}); |
| 11761 | 11787 | return ip.getOrPutTrailingString(gpa, tid, @intCast(slice.len + 1), embedded_nulls); |
| 11762 | 11788 | } |
| 11763 | 11789 | |
| ... | ... | @@ -11772,8 +11798,8 @@ pub fn getOrPutStringFmt( |
| 11772 | 11798 | // ensure that references to strings in args do not get invalidated |
| 11773 | 11799 | const format_z = format ++ .{0}; |
| 11774 | 11800 | const len: u32 = @intCast(std.fmt.count(format_z, args)); |
| 11775 | | const strings = ip.getLocal(tid).getMutableStrings(gpa); |
| 11776 | | const slice = try strings.addManyAsSlice(len); |
| 11801 | const string_bytes = ip.getLocal(tid).getMutableStringBytes(gpa); |
| 11802 | const slice = try string_bytes.addManyAsSlice(len); |
| 11777 | 11803 | assert((std.fmt.bufPrint(slice[0], format_z, args) catch unreachable).len == len); |
| 11778 | 11804 | return ip.getOrPutTrailingString(gpa, tid, len, embedded_nulls); |
| 11779 | 11805 | } |
| ... | ... | @@ -11797,21 +11823,27 @@ pub fn getOrPutTrailingString( |
| 11797 | 11823 | len: u32, |
| 11798 | 11824 | comptime embedded_nulls: EmbeddedNulls, |
| 11799 | 11825 | ) Allocator.Error!embedded_nulls.StringType() { |
| 11800 | | const strings = ip.getLocal(tid).getMutableStrings(gpa); |
| 11801 | | const start: u32 = @intCast(strings.mutate.len - len); |
| 11802 | | if (len > 0 and strings.view().items(.@"0")[strings.mutate.len - 1] == 0) { |
| 11803 | | strings.mutate.len -= 1; |
| 11826 | const local = ip.getLocal(tid); |
| 11827 | const strings = local.getMutableStrings(gpa); |
| 11828 | try strings.ensureUnusedCapacity(1); |
| 11829 | const string_bytes = local.getMutableStringBytes(gpa); |
| 11830 | const start: u32 = @intCast(string_bytes.mutate.len - len); |
| 11831 | if (len > 0 and string_bytes.view().items(.@"0")[string_bytes.mutate.len - 1] == 0) { |
| 11832 | string_bytes.mutate.len -= 1; |
| 11804 | 11833 | } else { |
| 11805 | | try strings.ensureUnusedCapacity(1); |
| 11834 | try string_bytes.ensureUnusedCapacity(1); |
| 11806 | 11835 | } |
| 11807 | | const key: []const u8 = strings.view().items(.@"0")[start..]; |
| 11808 | | const value: embedded_nulls.StringType() = |
| 11809 | | @enumFromInt(@intFromEnum((String.Unwrapped{ .tid = tid, .index = start }).wrap(ip))); |
| 11836 | const key: []const u8 = string_bytes.view().items(.@"0")[start..]; |
| 11837 | const value: embedded_nulls.StringType() = @enumFromInt(@intFromEnum((String.Unwrapped{ |
| 11838 | .tid = tid, |
| 11839 | .index = strings.mutate.len - 1, |
| 11840 | }).wrap(ip))); |
| 11810 | 11841 | const has_embedded_null = std.mem.indexOfScalar(u8, key, 0) != null; |
| 11811 | 11842 | switch (embedded_nulls) { |
| 11812 | 11843 | .no_embedded_nulls => assert(!has_embedded_null), |
| 11813 | 11844 | .maybe_embedded_nulls => if (has_embedded_null) { |
| 11814 | | strings.appendAssumeCapacity(.{0}); |
| 11845 | string_bytes.appendAssumeCapacity(.{0}); |
| 11846 | strings.appendAssumeCapacity(.{string_bytes.mutate.len}); |
| 11815 | 11847 | return value; |
| 11816 | 11848 | }, |
| 11817 | 11849 | } |
| ... | ... | @@ -11829,7 +11861,7 @@ pub fn getOrPutTrailingString( |
| 11829 | 11861 | const index = entry.acquire().unwrap() orelse break; |
| 11830 | 11862 | if (entry.hash != hash) continue; |
| 11831 | 11863 | if (!index.eqlSlice(key, ip)) continue; |
| 11832 | | strings.shrinkRetainingCapacity(start); |
| 11864 | string_bytes.shrinkRetainingCapacity(start); |
| 11833 | 11865 | return @enumFromInt(@intFromEnum(index)); |
| 11834 | 11866 | } |
| 11835 | 11867 | shard.mutate.string_map.mutex.lock(); |
| ... | ... | @@ -11845,19 +11877,20 @@ pub fn getOrPutTrailingString( |
| 11845 | 11877 | const index = entry.acquire().unwrap() orelse break; |
| 11846 | 11878 | if (entry.hash != hash) continue; |
| 11847 | 11879 | if (!index.eqlSlice(key, ip)) continue; |
| 11848 | | strings.shrinkRetainingCapacity(start); |
| 11880 | string_bytes.shrinkRetainingCapacity(start); |
| 11849 | 11881 | return @enumFromInt(@intFromEnum(index)); |
| 11850 | 11882 | } |
| 11851 | 11883 | defer shard.mutate.string_map.len += 1; |
| 11852 | 11884 | const map_header = map.header().*; |
| 11853 | 11885 | if (shard.mutate.string_map.len < map_header.capacity * 3 / 5) { |
| 11854 | | strings.appendAssumeCapacity(.{0}); |
| 11886 | string_bytes.appendAssumeCapacity(.{0}); |
| 11887 | strings.appendAssumeCapacity(.{string_bytes.mutate.len}); |
| 11855 | 11888 | const entry = &map.entries[map_index]; |
| 11856 | 11889 | entry.hash = hash; |
| 11857 | 11890 | entry.release(@enumFromInt(@intFromEnum(value))); |
| 11858 | 11891 | return value; |
| 11859 | 11892 | } |
| 11860 | | const arena_state = &ip.getLocal(tid).mutate.arena; |
| 11893 | const arena_state = &local.mutate.arena; |
| 11861 | 11894 | var arena = arena_state.promote(gpa); |
| 11862 | 11895 | defer arena_state.* = arena.state; |
| 11863 | 11896 | const new_map_capacity = map_header.capacity * 2; |
| ... | ... | @@ -11893,7 +11926,8 @@ pub fn getOrPutTrailingString( |
| 11893 | 11926 | map_index &= new_map_mask; |
| 11894 | 11927 | if (map.entries[map_index].value == .none) break; |
| 11895 | 11928 | } |
| 11896 | | strings.appendAssumeCapacity(.{0}); |
| 11929 | string_bytes.appendAssumeCapacity(.{0}); |
| 11930 | strings.appendAssumeCapacity(.{string_bytes.mutate.len}); |
| 11897 | 11931 | map.entries[map_index] = .{ |
| 11898 | 11932 | .value = @enumFromInt(@intFromEnum(value)), |
| 11899 | 11933 | .hash = hash, |