| ... | ... | @@ -602,32 +602,32 @@ test failing { |
| 602 | 602 | test "free single-pointer to array" { |
| 603 | 603 | const allocator = std.testing.allocator; |
| 604 | 604 | { |
| 605 | | const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest; |
| 606 | | slice[127] = 0; |
| 607 | | const ptr = slice[0..127 :0]; |
| 605 | const allocation = try allocator.alloc(u32, 128); |
| 606 | allocation[127] = 0; |
| 607 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 608 | 608 | allocator.free(ptr); |
| 609 | 609 | } |
| 610 | 610 | { |
| 611 | | const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest; |
| 612 | | slice[127] = 0; |
| 613 | | const ptr = slice[0..127 :0]; |
| 611 | const allocation = try allocator.alloc(u32, 128); |
| 612 | allocation[127] = 0; |
| 613 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 614 | 614 | if (allocator.resize(ptr, 16)) { |
| 615 | 615 | allocator.free(ptr[0..16]); |
| 616 | 616 | } else allocator.free(ptr); |
| 617 | 617 | } |
| 618 | 618 | { |
| 619 | | const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest; |
| 620 | | slice[127] = 0; |
| 621 | | const ptr = slice[0..127 :0]; |
| 619 | const allocation = try allocator.alloc(u32, 128); |
| 620 | allocation[127] = 0; |
| 621 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 622 | 622 | if (allocator.remap(ptr, 16)) |new| { |
| 623 | 623 | allocator.free(new); |
| 624 | 624 | } else allocator.free(ptr); |
| 625 | 625 | } |
| 626 | 626 | { |
| 627 | | const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest; |
| 628 | | slice[127] = 0; |
| 629 | | const ptr = slice[0..127 :0]; |
| 630 | | const new = allocator.realloc(ptr, 16) catch return error.SkipZigTest; |
| 627 | const allocation = try allocator.alloc(u32, 128); |
| 628 | allocation[127] = 0; |
| 629 | const ptr: *[127:0]u32 = allocation[0..127 :0]; |
| 630 | const new = try allocator.realloc(ptr, 16); |
| 631 | 631 | allocator.free(new); |
| 632 | 632 | } |
| 633 | 633 | } |