authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-08-01 02:32:39-07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-08-01 02:32:39-07:00
logdaa45d99dc3eac1f38b0f3f4c138483f310860a0
treef68832611b6f4915efd8ce7d21491c8f9ca49fcf
parentde2862be18e85f25ab526bbd98c2b46b0dae4865
signature Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

getObject: alloc loose object content with not mmap


1 files changed, 3 insertions(+), 2 deletions(-)

git.zig+3-2
...@@ -812,8 +812,9 @@ pub const Repository = struct {...@@ -812,8 +812,9 @@ pub const Repository = struct {
812 else => |e| return e,812 else => |e| return e,
813 };813 };
814 defer objfile.close();814 defer objfile.close();
815 const compressed_content = try objfile.mmap();815 const stat = try objfile.stat();
816 defer nfs.munmap(compressed_content);816 const compressed_content = try objfile.readAlloc(r.gpa, stat.size);
817 defer r.gpa.free(compressed_content);
817 var list: nio.AllocatingWriter = .init(r.gpa);818 var list: nio.AllocatingWriter = .init(r.gpa);
818 errdefer list.deinit();819 errdefer list.deinit();
819 try list.ensureUnusedCapacity(512);820 try list.ensureUnusedCapacity(512);