#Can I force `std.testing.allocator` to not log/report leaked memory?

1 messages · Page 1 of 1 (latest)

tropic ridge
#

I have a test that's allocating a ton of memory and can crash very hard. To the point where the leaked memory logging is like thousands of lines. How can I configure it to not log leaks (obviously just while debugging a problem)?

#

Do I just use a different allocator??? haha

#

For now I'm just gonna use std.heap.c_allocator.

#

I assume you can configure testing allocator though right? Just like a GPA.

woeful silo
#

either that or edit test_runner.zig, you can't configure it directly

tropic ridge
#

👍

woeful silo
#

I mean it's "just" a named GPA, so you can create your own and it's the same thing

tropic ridge
#

True.

#

Wasn't sure if there might have been some module level variable like std.testing.allocator_leak_log or something similar I could change blah blah.