mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 22:34:28 +00:00
use allocator.shrink instead of realloc in os.path.real
This commit is contained in:
parent
e6334fe46d
commit
1c28631738
1 changed files with 1 additions and 1 deletions
|
|
@ -1006,7 +1006,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 {
|
||||||
else => error.Unexpected,
|
else => error.Unexpected,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return allocator.realloc(u8, result_buf, cstr.len(result_buf.ptr));
|
return allocator.shrink(u8, result_buf, cstr.len(result_buf.ptr));
|
||||||
},
|
},
|
||||||
Os.linux => {
|
Os.linux => {
|
||||||
const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);
|
const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue