arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Have test runner check for leaks caused by `error.OutOfMemory`

Open ehaas opened this issue 4 years ago • 0 comments

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.

ehaas avatar Nov 03 '21 21:11 ehaas