summaryrefslogtreecommitdiff
path: root/src/zisp/value.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zisp/value.zig')
-rw-r--r--src/zisp/value.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig
index fc815bd..c16b937 100644
--- a/src/zisp/value.zig
+++ b/src/zisp/value.zig
@@ -27,8 +27,8 @@ const endian = builtin.target.cpu.arch.endian();
const max = std.math.maxInt;
/// Used to find the length of a rune or short string.
-pub fn sstrLen(x: u64) u8 {
- const bytes: @Vector(8, u8) = @bitCast(x);
+pub fn sstrLen(v: *const Value) u8 {
+ const bytes: @Vector(8, u8) = @bitCast(v.bits);
const nulls: @Vector(8, u8) = @splat(0);
const comps: u8 = @bitCast(bytes == nulls);
// Two bits will always be 0, since the actual short string starts at the
@@ -64,16 +64,16 @@ pub const Zptr = *align(16) anyopaque;
/// Values for the lowest 4 bits of a heap pointer, indicating the heap type.
pub const HeapType = enum(u4) {
/// Unused so the 48-bit payload of a NaN-packed pointer is never zero and
- /// cannot be confused for an actual NaN even in case of a null-index.
+ /// cannot be confused for an actual NaN even in case of a null index.
_unused = 0,
- /// Array of various types (see `Array` type for details)
+ /// Array of various types: see `ArrayPtr`.
array,
pub fn PtrType(self: HeapType) type {
return switch (self) {
.array => array.ArrayPtr,
- else => @panic("not implemented"),
+ else => @panic("Invalid HeapType."),
};
}
};