authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-03-28 18:05:01-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-03-28 18:05:01-04:00
logf48f7f43fe7095fd13995d838b1452d67fc00ac7
tree2dc0780f7ee2ee763184c63d0c8d5beb1ef04227
parenta32b5929ccf8cbf79396d8924097a1a911985dac

std/mem: take advantage of new printf


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

std/mem.zig+1-4
...@@ -17,10 +17,7 @@ pub const Allocator = struct {...@@ -17,10 +17,7 @@ pub const Allocator = struct {
17 /// Aborts the program if an allocation fails.17 /// Aborts the program if an allocation fails.
18 fn checkedAlloc(self: &Allocator, comptime T: type, n: usize) -> []T {18 fn checkedAlloc(self: &Allocator, comptime T: type, n: usize) -> []T {
19 alloc(self, T, n) %% |err| {19 alloc(self, T, n) %% |err| {
20 // TODO var args printf20 %%io.stderr.printf("allocation failure: {}\n", @errorName(err));
21 %%io.stderr.write("allocation failure: ");
22 %%io.stderr.write(@errorName(err));
23 %%io.stderr.printf("\n");
24 os.abort()21 os.abort()
25 }22 }
26 }23 }