| ... | @@ -17,8 +17,8 @@ pub var c_allocator = Allocator { | ... | @@ -17,8 +17,8 @@ pub var c_allocator = Allocator { |
| 17 | }; | 17 | }; |
| 18 | | 18 | |
| 19 | fn cAlloc(self: &Allocator, n: usize, alignment: usize) -> %[]u8 { | 19 | fn cAlloc(self: &Allocator, n: usize, alignment: usize) -> %[]u8 { |
| 20 | if (c.malloc(usize(n))) |mem| { | 20 | if (c.malloc(usize(n))) |buf| { |
| 21 | @ptrCast(&u8, mem)[0..n] | 21 | @ptrCast(&u8, buf)[0..n] |
| 22 | } else { | 22 | } else { |
| 23 | error.OutOfMemory | 23 | error.OutOfMemory |
| 24 | } | 24 | } |
| ... | @@ -29,8 +29,8 @@ fn cRealloc(self: &Allocator, old_mem: []u8, new_size: usize, alignment: usize) | ... | @@ -29,8 +29,8 @@ fn cRealloc(self: &Allocator, old_mem: []u8, new_size: usize, alignment: usize) |
| 29 | old_mem[0..new_size] | 29 | old_mem[0..new_size] |
| 30 | } else { | 30 | } else { |
| 31 | const old_ptr = @ptrCast(&c_void, old_mem.ptr); | 31 | const old_ptr = @ptrCast(&c_void, old_mem.ptr); |
| 32 | if (c.realloc(old_ptr, usize(new_size))) |mem| { | 32 | if (c.realloc(old_ptr, usize(new_size))) |buf| { |
| 33 | @ptrCast(&u8, mem)[0..new_size] | 33 | @ptrCast(&u8, buf)[0..new_size] |
| 34 | } else { | 34 | } else { |
| 35 | error.OutOfMemory | 35 | error.OutOfMemory |
| 36 | } | 36 | } |