diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-09 09:56:24 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-09 09:56:24 -0500 |
| commit | d1d3dbc7b5bc986849db476e491300ffd18d4db5 (patch) | |
| tree | 8ab3bb2b5b8a82edf18caca6e28dc8e74ab81d11 /std/mem.zig | |
| parent | 5a8d87f5042b5ab86de7c72df4ce84a314878e40 (diff) | |
| parent | 3c094116aae459b651934663a31981cf09cdb3e4 (diff) | |
| download | zig-d1d3dbc7b5bc986849db476e491300ffd18d4db5.tar.gz zig-d1d3dbc7b5bc986849db476e491300ffd18d4db5.zip | |
Merge branch 'master' into llvm6
Diffstat (limited to 'std/mem.zig')
| -rw-r--r-- | std/mem.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/mem.zig b/std/mem.zig index bc16abf362..2d5b6f7a25 100644 --- a/std/mem.zig +++ b/std/mem.zig @@ -93,7 +93,7 @@ pub const Allocator = struct { // n <= old_mem.len and the multiplication didn't overflow for that operation. const byte_count = @sizeOf(T) * n; - const byte_slice = %%self.reallocFn(self, ([]u8)(old_mem), byte_count, alignment); + const byte_slice = self.reallocFn(self, ([]u8)(old_mem), byte_count, alignment) catch unreachable; return ([]align(alignment) T)(@alignCast(alignment, byte_slice)); } @@ -446,8 +446,8 @@ pub fn join(allocator: &Allocator, sep: u8, strings: ...) -> %[]u8 { } test "mem.join" { - assert(eql(u8, %%join(debug.global_allocator, ',', "a", "b", "c"), "a,b,c")); - assert(eql(u8, %%join(debug.global_allocator, ',', "a"), "a")); + assert(eql(u8, try join(debug.global_allocator, ',', "a", "b", "c"), "a,b,c")); + assert(eql(u8, try join(debug.global_allocator, ',', "a"), "a")); } test "testStringEquality" { |
