From af42ac0a082c90b6dfced76cd1ecdf5091e22c7e Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Sun, 21 Jun 2026 23:31:08 +0200 Subject: yippie --- src/zisp/value/list.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/zisp/value') diff --git a/src/zisp/value/list.zig b/src/zisp/value/list.zig index d040a34..52c665e 100644 --- a/src/zisp/value/list.zig +++ b/src/zisp/value/list.zig @@ -26,7 +26,7 @@ pub fn assert(v: Value) void { pub fn new(alloc: Alloc, pool: ?*ListPool, vals: []const Value) !Value { var len_tagged_ptr: u48 = undefined; if (vals.len < 8 and pool != null) { - const ptr = try pool.?.create(@intCast(vals.len)); + const ptr = try pool.?.allocVals(@intCast(vals.len)); for (vals, 0..) |v, i| ptr[i] = v; len_tagged_ptr = @intCast(@intFromPtr(ptr) | vals.len); } else { @@ -38,6 +38,11 @@ pub fn new(alloc: Alloc, pool: ?*ListPool, vals: []const Value) !Value { return .{ .list = .{ .len_tagged_ptr = len_tagged_ptr } }; } +// TODO: this is just a test +pub fn free(list: Value) !void { + try gc.mainListPool().freeList(list); +} + pub fn getLenTag(v: Value) u3 { return @truncate(v.bits); } -- cgit v1.2.3