diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-05 19:13:43 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:42:29 -0700 |
| commit | 31aee50c1a96b7e72b42ee885636b27fbcac8eb4 (patch) | |
| tree | ddd17a80a48fa620a6d4cea9d8f6a970eb90845d /src/value.zig | |
| parent | 08e97639513f09e2797bd7afcdfdfecdad6c6fd8 (diff) | |
| download | zig-31aee50c1a96b7e72b42ee885636b27fbcac8eb4.tar.gz zig-31aee50c1a96b7e72b42ee885636b27fbcac8eb4.zip | |
InternPool: add a slice encoding
This uses the data field to reference its pointer field type, which
allows for efficient and infallible access of a slice type's pointer
type.
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/value.zig b/src/value.zig index a34a022dea..f8188c64ab 100644 --- a/src/value.zig +++ b/src/value.zig @@ -2078,7 +2078,7 @@ pub const Value = struct { } var ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined; - const ptr_ty = ty.slicePtrFieldType(&ptr_buf); + const ptr_ty = ty.slicePtrFieldType(&ptr_buf, mod); return eqlAdvanced(a_payload.ptr, ptr_ty, b_payload.ptr, ptr_ty, mod, opt_sema); }, @@ -2237,7 +2237,7 @@ pub const Value = struct { } var ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined; - const ptr_ty = ty.slicePtrFieldType(&ptr_buf); + const ptr_ty = ty.slicePtrFieldType(&ptr_buf, mod); const a_ptr = switch (a_ty.ptrSize(mod)) { .Slice => a.slicePtr(), .One => a, @@ -2376,7 +2376,7 @@ pub const Value = struct { .slice => { const slice = val.castTag(.slice).?.data; var ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined; - const ptr_ty = ty.slicePtrFieldType(&ptr_buf); + const ptr_ty = ty.slicePtrFieldType(&ptr_buf, mod); hash(slice.ptr, ptr_ty, hasher, mod); hash(slice.len, Type.usize, hasher, mod); }, @@ -2499,7 +2499,7 @@ pub const Value = struct { .slice => { const slice = val.castTag(.slice).?.data; var ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined; - const ptr_ty = ty.slicePtrFieldType(&ptr_buf); + const ptr_ty = ty.slicePtrFieldType(&ptr_buf, mod); slice.ptr.hashUncoerced(ptr_ty, hasher, mod); }, else => val.hashPtr(hasher, mod), |
