diff --git a/lib/std/heap/logging_allocator.zig b/lib/std/heap/logging_allocator.zig index d1b7f4776d..7dce7bc20a 100644 --- a/lib/std/heap/logging_allocator.zig +++ b/lib/std/heap/logging_allocator.zig @@ -57,7 +57,7 @@ test "LoggingAllocator" { var slice_stream = std.io.SliceOutStream.init(buf[0..]); const stream = &slice_stream.stream; - const allocator = &LoggingAllocator.init(std.heap.page_allocator, @ptrCast(*AnyErrorOutStream, stream)).allocator; + const allocator = &LoggingAllocator.init(std.testing.allocator, @ptrCast(*AnyErrorOutStream, stream)).allocator; const ptr = try allocator.alloc(u8, 10); allocator.free(ptr); diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 4850f2e9b9..f8247b5a9d 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -12,7 +12,7 @@ pub var allocator_instance = LeakCountAllocator.init(&base_allocator_instance.al pub const failing_allocator = &FailingAllocator.init(&base_allocator_instance.allocator, 0).allocator; pub var base_allocator_instance = std.heap.ThreadSafeFixedBufferAllocator.init(allocator_mem[0..]); -var allocator_mem: [100 * 1024]u8 = undefined; +var allocator_mem: [512 * 1024]u8 = undefined; /// This function is intended to be used only in tests. It prints diagnostics to stderr /// and then aborts when actual_error_union is not expected_error. diff --git a/test/cli.zig b/test/cli.zig index 0527b5c923..b7d03d9e21 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -8,7 +8,7 @@ const ChildProcess = std.ChildProcess; var a: *std.mem.Allocator = undefined; pub fn main() !void { - var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); + var arena = std.heap.ArenaAllocator.init(std.testing.allocator); defer arena.deinit(); var arg_it = process.args(); diff --git a/test/stage1/behavior/async_fn.zig b/test/stage1/behavior/async_fn.zig index c7ea183b6f..fb740ead42 100644 --- a/test/stage1/behavior/async_fn.zig +++ b/test/stage1/behavior/async_fn.zig @@ -935,12 +935,12 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type { _ = async amain(&result); return result; } else { - return fib(std.heap.page_allocator, 10) catch unreachable; + return fib(std.testing.allocator, 10) catch unreachable; } } fn amain(result: *u32) void { - var x = async fib(std.heap.page_allocator, 10); + var x = async fib(std.testing.allocator, 10); result.* = (await x) catch unreachable; } };