use allocator.shrink instead of realloc in os.path.real
This commit is contained in:
parent
e6334fe46d
commit
1c28631738
@ -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…
x
Reference in New Issue
Block a user