authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-02-05 20:23:21-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-02-06 14:23:23-08:00
logd0e1a6a23de8620a42829a95343b297cefc1c7a4
tree6e37b5666ab42341b3a3aff1e9d78df1a42f3294
parent960190643ab4fe2227cbc7ab69a3907bf6722a6e

std.heap.DebugAllocator: update unit tests for new impl

No longer need this windows-specific behavior.

1 files changed, 2 insertions(+), 8 deletions(-)

lib/std/heap/debug_allocator.zig+2-8
......@@ -1220,10 +1220,7 @@ test "shrink large object to large object with larger alignment" {
12201220 var slice = try allocator.alignedAlloc(u8, 16, alloc_size);
12211221 defer allocator.free(slice);
12221222
1223 const big_alignment: usize = switch (builtin.os.tag) {
1224 .windows => default_page_size * 32, // Windows aligns to 64K.
1225 else => default_page_size * 2,
1226 };
1223 const big_alignment: usize = default_page_size * 2;
12271224 // This loop allocates until we find a page that is not aligned to the big
12281225 // alignment. Then we shrink the allocation after the loop, but increase the
12291226 // alignment to the higher one, that we know will force it to realloc.
......@@ -1297,10 +1294,7 @@ test "realloc large object to larger alignment" {
12971294 var slice = try allocator.alignedAlloc(u8, 16, default_page_size * 2 + 50);
12981295 defer allocator.free(slice);
12991296
1300 const big_alignment: usize = switch (builtin.os.tag) {
1301 .windows => default_page_size * 32, // Windows aligns to 64K.
1302 else => default_page_size * 2,
1303 };
1297 const big_alignment: usize = default_page_size * 2;
13041298 // This loop allocates until we find a page that is not aligned to the big alignment.
13051299 var stuff_to_free = std.ArrayList([]align(16) u8).init(debug_allocator);
13061300 while (mem.isAligned(@intFromPtr(slice.ptr), big_alignment)) {