Skip to content

Commit 56fca8a

Browse files
committed
std.heap.DebugAllocator: update unit tests for new impl
No longer need this windows-specific behavior.
1 parent c459af3 commit 56fca8a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/std/heap/debug_allocator.zig

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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)) {

0 commit comments

Comments
 (0)