| author | |
| committer | |
| log | c0924842744fea67df49c9942b99d855b83578e5 |
| tree | f6df93ddc55680ede4f764f88ba3f24af317999f |
| parent | 16fbd314dc9590077267fc373b76b7c7b977977a |
1 files changed, 5 insertions(+), 2 deletions(-)
lib/std/mem/Allocator.zig+5-2| ... | ... | @@ -627,7 +627,10 @@ test "free single-pointer to array" { |
| 627 | 627 | const allocation = try allocator.alloc(u32, 128); |
| 628 | 628 | allocation[127] = 0; |
| 629 | 629 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 630 | const new = try allocator.realloc(ptr, 16); | |
| 631 | allocator.free(new); | |
| 630 | if (allocator.realloc(ptr, 16)) |new| { | |
| 631 | allocator.free(new); | |
| 632 | } else |_| { | |
| 633 | allocator.free(allocation); | |
| 634 | } | |
| 632 | 635 | } |
| 633 | 636 | } |