diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-31 21:54:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-08-11 15:52:49 -0700 |
| commit | 749f10af49022597d873d41df5c600e97e5c4a37 (patch) | |
| tree | cb6da80d28fa284bdeb7b40d26ce8de9ca9b2306 /lib/std/heap/debug_allocator.zig | |
| parent | d625158354a02a18e9ae7975a144f30838884d5c (diff) | |
| download | zig-749f10af49022597d873d41df5c600e97e5c4a37.tar.gz zig-749f10af49022597d873d41df5c600e97e5c4a37.zip | |
std.ArrayList: make unmanaged the default
Diffstat (limited to 'lib/std/heap/debug_allocator.zig')
| -rw-r--r-- | lib/std/heap/debug_allocator.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/heap/debug_allocator.zig b/lib/std/heap/debug_allocator.zig index 97b884ec64..a4b1de5b47 100644 --- a/lib/std/heap/debug_allocator.zig +++ b/lib/std/heap/debug_allocator.zig @@ -1061,7 +1061,7 @@ test "small allocations - free in same order" { defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); const allocator = gpa.allocator(); - var list = std.ArrayList(*u64).init(std.testing.allocator); + var list = std.array_list.Managed(*u64).init(std.testing.allocator); defer list.deinit(); var i: usize = 0; @@ -1080,7 +1080,7 @@ test "small allocations - free in reverse order" { defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak"); const allocator = gpa.allocator(); - var list = std.ArrayList(*u64).init(std.testing.allocator); + var list = std.array_list.Managed(*u64).init(std.testing.allocator); defer list.deinit(); var i: usize = 0; @@ -1241,7 +1241,7 @@ test "shrink large object to large object with larger alignment" { // This loop allocates until we find a page that is not aligned to the big // alignment. Then we shrink the allocation after the loop, but increase the // alignment to the higher one, that we know will force it to realloc. - var stuff_to_free = std.ArrayList([]align(16) u8).init(debug_allocator); + var stuff_to_free = std.array_list.Managed([]align(16) u8).init(debug_allocator); while (mem.isAligned(@intFromPtr(slice.ptr), big_alignment)) { try stuff_to_free.append(slice); slice = try allocator.alignedAlloc(u8, .@"16", alloc_size); @@ -1313,7 +1313,7 @@ test "realloc large object to larger alignment" { const big_alignment: usize = default_page_size * 2; // This loop allocates until we find a page that is not aligned to the big alignment. - var stuff_to_free = std.ArrayList([]align(16) u8).init(debug_allocator); + var stuff_to_free = std.array_list.Managed([]align(16) u8).init(debug_allocator); while (mem.isAligned(@intFromPtr(slice.ptr), big_alignment)) { try stuff_to_free.append(slice); slice = try allocator.alignedAlloc(u8, .@"16", default_page_size * 2 + 50); |
