From 1b886923d74863cbe334f06464a508bcd098157e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 23 Oct 2026 03:12:29 -0300 Subject: fs: look through parked slots by pointer references() iterated s.slots by value, which copied every slot with its park data (8 MiB at the default capacity) onto the caller's stack: in pardes that left the editor thread's whole 8 MiB stack resident. Co-Authored-By: Claude Opus 5.5 --- src/fs.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fs.zig b/src/fs.zig index acb896b..7db6d08 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -591,7 +591,9 @@ pub fn Server(comptime Backend: type, comptime opts: Options) type { const held = if (opts.fid_index) s.fids[0..s.high_water] else s.fids[0..]; for (held) |fid| if (fid.used and fid.node == node) return true; if (s.job.kind != .none and s.job.node == node) return true; - for (s.slots) |slot| if (slot.used and slot.req.node == node) return true; + // By pointer: by value copied every slot, park data and all + // (8 MiB at the default capacity), onto the caller's stack. + for (&s.slots) |*slot| if (slot.used and slot.req.node == node) return true; return false; } -- cgit v1.3