srctree

Gregory Mullen parent 27253073 ab93ec30
new zig stdlib api

src/git/agent.zig added: 10, removed: 10, total 0
@@ -142,11 +142,11 @@ fn execStdin(self: Agent, argv: []const []const u8, stdin: []const u8) !std.proc
child.stderr_behavior = .Pipe;
child.cwd_dir = cwd;
 
var stdout = std.ArrayList(u8).init(self.alloc);
var stderr = std.ArrayList(u8).init(self.alloc);
var stdout = std.ArrayListUnmanaged(u8){};
var stderr = std.ArrayListUnmanaged(u8){};
errdefer {
stdout.deinit();
stderr.deinit();
stdout.deinit(self.alloc);
stderr.deinit(self.alloc);
}
 
try child.spawn();
@@ -156,7 +156,7 @@ fn execStdin(self: Agent, argv: []const []const u8, stdin: []const u8) !std.proc
child.stdin = null;
}
 
child.collectOutput(&stdout, &stderr, 0x1fffff) catch |err| {
child.collectOutput(self.alloc, &stdout, &stderr, 0x1fffff) catch |err| {
const errstr =
\\git agent error:
\\error :: {}
@@ -170,8 +170,8 @@ fn execStdin(self: Agent, argv: []const []const u8, stdin: []const u8) !std.proc
 
const res = std.process.Child.RunResult{
.term = try child.wait(),
.stdout = try stdout.toOwnedSlice(),
.stderr = try stderr.toOwnedSlice(),
.stdout = try stdout.toOwnedSlice(self.alloc),
.stderr = try stderr.toOwnedSlice(self.alloc),
};
 
return res;
 
src/git/pack.zig added: 10, removed: 10, total 0
@@ -104,7 +104,7 @@ fn mmap(f: std.fs.File) ![]u8 {
return std.posix.mmap(null, length, PROT.READ, .{ .TYPE = .SHARED }, f.handle, offset);
}
 
fn munmap(mem: []align(std.mem.page_size) const u8) void {
fn munmap(mem: []align(std.heap.page_size_min) const u8) void {
std.posix.munmap(mem);
}