mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
std/mem: take advantage of new printf
This commit is contained in:
parent
a32b5929cc
commit
f48f7f43fe
@ -17,10 +17,7 @@ pub const Allocator = struct {
|
||||
/// Aborts the program if an allocation fails.
|
||||
fn checkedAlloc(self: &Allocator, comptime T: type, n: usize) -> []T {
|
||||
alloc(self, T, n) %% |err| {
|
||||
// TODO var args printf
|
||||
%%io.stderr.write("allocation failure: ");
|
||||
%%io.stderr.write(@errorName(err));
|
||||
%%io.stderr.printf("\n");
|
||||
%%io.stderr.printf("allocation failure: {}\n", @errorName(err));
|
||||
os.abort()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user