summaryrefslogtreecommitdiff
path: root/src/Handover.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 12:14:58 -0300
committerGabriel Schneider <[email protected]>2026-11-06 14:56:36 -0300
commit60dd9514c8676e79c625948b5e9d2c6d745e8e87 (patch)
tree9c8009a5f47314ccd6e98b1a001e965ecb0b6444 /src/Handover.zig
parent4839c4b037d401393bbc87143d663e115c71242e (diff)
downloadpardes-60dd9514c8676e79c625948b5e9d2c6d745e8e87.tar.gz
pardes-60dd9514c8676e79c625948b5e9d2c6d745e8e87.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Handover.zig')
-rw-r--r--src/Handover.zig4
1 files changed, 2 insertions, 2 deletions
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;
}