From 60dd9514c8676e79c625948b5e9d2c6d745e8e87 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:14:58 -0300 Subject: idioms #3, the allocator a function is handed: Handover.carries opens its dump with the caller's gpa, not the page allocator, and Client.follow and stepGlide lose the gpa they never used Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Handover.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Handover.zig') diff --git a/src/Handover.zig b/src/Handover.zig index e9e0622b..ed52271f 100644 --- a/src/Handover.zig +++ b/src/Handover.zig @@ -223,10 +223,10 @@ fn dumpCarried(p: *Pardes, kind: Kind, at: usize, ids: []const usize, seq: u32) /// Whether `bytes` are a handover's dump (`dumpCarried`'s, or an older /// build's), not a session's. -pub fn carries(bytes: []const u8) bool { +pub fn carries(gpa: std.mem.Allocator, bytes: []const u8) bool { if (std.mem.startsWith(u8, bytes, carried_magic)) return true; if (!pardes.Db.isImage(bytes)) return false; - const r = pardes.Db.Read.open(std.heap.page_allocator, bytes, null) catch return false; + const r = pardes.Db.Read.open(gpa, bytes, null) catch return false; defer r.close(); return (walk.Get.member(r.root(), "carried") catch null) != null; } -- cgit v1.3