diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-08-16 10:01:12 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-08-16 10:01:12 +0200 |
| commit | e26e81aa33dc1ecc2f26de26b1d420d288a28493 (patch) | |
| tree | d0c906f3b6d504870a171f57709c6e912a3fc9c4 /src/zisp/value.zig | |
| parent | 0e073b94c90b78ebe156adb27ec4456e86935d42 (diff) | |
Implemented meta allocator.
Diffstat (limited to 'src/zisp/value.zig')
| -rw-r--r-- | src/zisp/value.zig | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig index f075b35..aff05fe 100644 --- a/src/zisp/value.zig +++ b/src/zisp/value.zig @@ -101,8 +101,8 @@ pub const HeapType = enum(u8) { pub fn of(ptr: anytype) HeapType { return switch (@TypeOf(ptr)) { - PairPtr => .pair, - ArrayHeader => .array, + pair.PairPtr => .pair, + array.ArrayPtr => .array, else => @panic("Unknown heap pointer."), }; } @@ -316,12 +316,17 @@ pub const Value = packed union { /// Check for small rat (rational number). pub fn isSrat(v: Value) bool { - return v.srat._hi == hi15_srat; + return v.srat._hi == hi16_srat; } - /// Placeholder: Check for (undefined). - pub fn isNdef(v: Value) bool { - return v.ndef._hi == hi15_ndef; + /// Placeholder: Check for (undefined 1). + pub fn isNdf1(v: Value) bool { + return v.ndf1._hi == hi16_ndf1; + } + + /// Placeholder: Check for (undefined 2). + pub fn isNdf2(v: Value) bool { + return v.ndf2._hi == hi16_ndf2; } /// Check for rune. |
