authorgravatar for scurest@users.noreply.github.comscurest <scurest@users.noreply.github.com> 2017-11-05 15:46:21-06:00
committergravatar for scurest@users.noreply.github.comscurest <scurest@users.noreply.github.com> 2017-11-05 15:46:54-06:00
log48c8181886e783aecb32c2c9ca9e2af1e39fd1bf
tree72665f75f2b000ddd6434343643f1db1d1aa1173
parentbd6f8d99c57004716333a3371fc6574fee534ecc

fix redeclaration of mem (#585)


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

std/heap.zig+4-4
......@@ -17,8 +17,8 @@ pub var c_allocator = Allocator {
1717};
1818
1919fn cAlloc(self: &Allocator, n: usize, alignment: usize) -> %[]u8 {
20 if (c.malloc(usize(n))) |mem| {
21 @ptrCast(&u8, mem)[0..n]
20 if (c.malloc(usize(n))) |buf| {
21 @ptrCast(&u8, buf)[0..n]
2222 } else {
2323 error.OutOfMemory
2424 }
......@@ -29,8 +29,8 @@ fn cRealloc(self: &Allocator, old_mem: []u8, new_size: usize, alignment: usize)
2929 old_mem[0..new_size]
3030 } else {
3131 const old_ptr = @ptrCast(&c_void, old_mem.ptr);
32 if (c.realloc(old_ptr, usize(new_size))) |mem| {
33 @ptrCast(&u8, mem)[0..new_size]
32 if (c.realloc(old_ptr, usize(new_size))) |buf| {
33 @ptrCast(&u8, buf)[0..new_size]
3434 } else {
3535 error.OutOfMemory
3636 }