arocc
arocc copied to clipboard
Have test runner check for leaks caused by `error.OutOfMemory`
The Zig parser test uses a clever technique to check for correct memory handling during error conditions. Parse once using unlimited memory, measure how much was actually used, then parse again N times using FailingAllocator, once for each size up to the actual amount of memory used. Each of those should fail (if not, memory usage is unexpectedly non-deterministic) and should free the same number of bytes as were allocated.