So you decide to use std.experimental.allocator for your memory allocations. Let's say you're as paranoid as me about getting the allocations right. How do you know you're not leaking memory now (no GC safety net)?. Or worse, deallocating memory you shouldn't? The program didn't crash, but you never do know...

Enter the test allocator here:

Run your code through that little guy in a unittest build and worry no more. It throws an AssertError in the destructor if there's a memory leak and also if you try and deallocate memory that it doesn't know about. It's backed by Mallocator because then you can also use valgrind or address sanitizer to catch even more bugs.


Reply via email to