authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-10 11:31:53-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-10 11:31:53-04:00
log1c28631738a7b65e23e5bffc582695faf016045f
tree1c51f647ec36f92bc36e08ad425b372966cce388
parente6334fe46d29f3f9d488b80453cc5bd12ffb97ea

use allocator.shrink instead of realloc in os.path.real


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

std/os/path.zig+1-1
...@@ -1006,7 +1006,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 {...@@ -1006,7 +1006,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 {
1006 else => error.Unexpected,1006 else => error.Unexpected,
1007 };1007 };
1008 }1008 }
1009 return allocator.realloc(u8, result_buf, cstr.len(result_buf.ptr));1009 return allocator.shrink(u8, result_buf, cstr.len(result_buf.ptr));
1010 },1010 },
1011 Os.linux => {1011 Os.linux => {
1012 const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);1012 const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);