summaryrefslogtreecommitdiff
path: root/src/Kind.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kind.zig')
-rw-r--r--src/Kind.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Kind.zig b/src/Kind.zig
index 233365c7..bf8f14d1 100644
--- a/src/Kind.zig
+++ b/src/Kind.zig
@@ -218,8 +218,10 @@ pub const Slot = struct {
/// A client's join: its plain kind's file, until the pane is opened
/// from it (dump.plainHere).
file: ?[]u8 = null,
- /// Debug: the kind's allocations, which paint must leave as they are
- /// (the list the page allocator's: a region's first is slow in Debug).
+ /// Debug: the kind's allocations, which paint must leave as they are.
+ /// The slot's allocator's, as the slot is: a client's rollback puts
+ /// the list back with the slot that holds it (on the page allocator,
+ /// the list put back was one a speculation had grown and freed).
used: if (checked) std.ArrayList([]u8) else void = if (checked) .empty else {},
pub const Job = struct { token: u32, in: []u8 };
@@ -239,7 +241,7 @@ pub const Slot = struct {
pub fn free(s: *Slot) void {
for (&s.jobs) |*j| if (j.*) |job| s.gpa.free(job.in);
s.gpa.free(s.selection);
- if (checked) s.used.deinit(std.heap.page_allocator);
+ if (checked) s.used.deinit(s.gpa);
if (s.shadow) |sh| sh.deinit(s.gpa);
if (s.plain) |b| if (b.len > 0) s.gpa.free(b);
s.arena.deinit();
@@ -1088,7 +1090,7 @@ pub const api: c.pa_api = .{
break :mem cl.slot.arena.allocator().alignedAlloc(u8, .@"16", @max(n, 1)) catch return null;
};
@memset(mem, 0);
- if (checked) cl.slot.used.append(std.heap.page_allocator, mem) catch {};
+ if (checked) cl.slot.used.append(cl.slot.gpa, mem) catch {};
return mem.ptr;
}
}.f,