summaryrefslogtreecommitdiff
path: root/src/zisp/value/ptr.zig
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2026-08-16 10:01:12 +0200
committerTaylan Kammer <taylan.kammer@gmail.com>2026-08-16 10:01:12 +0200
commite26e81aa33dc1ecc2f26de26b1d420d288a28493 (patch)
treed0c906f3b6d504870a171f57709c6e912a3fc9c4 /src/zisp/value/ptr.zig
parent0e073b94c90b78ebe156adb27ec4456e86935d42 (diff)
Implemented meta allocator.
Diffstat (limited to 'src/zisp/value/ptr.zig')
-rw-r--r--src/zisp/value/ptr.zig33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/zisp/value/ptr.zig b/src/zisp/value/ptr.zig
deleted file mode 100644
index 8a3ca18..0000000
--- a/src/zisp/value/ptr.zig
+++ /dev/null
@@ -1,33 +0,0 @@
-const std = @import("std");
-
-const gc = @import("../gc.zig");
-const value = @import("../value.zig");
-
-const HeapType = value.HeapType;
-const Value = value.Value;
-const Zptr = value.Zptr;
-
-const max = std.math.maxInt;
-
-// Zig API
-
-pub fn check(v: Value) bool {
- return v.isPtrAny();
-}
-
-pub fn assert(v: Value) void {
- if (!check(v)) {
- v.dump();
- @panic("not pointer");
- }
-}
-
-pub fn pack(comptime ht: HeapType, ptr: ht.PtrType()) Value {
- const index: u44 = @intCast(@intFromPtr(ptr) >> 4);
- return .{ .ptr = .{ .index = index, .htype = ht } };
-}
-
-pub fn unpack(v: Value) struct { HeapType, ?Zptr } {
- assert(v);
- return v.getPtrAny() orelse unreachable;
-}