kingstnap 2 days ago

> However, although the code seemed correct, the debug allocator reported memory leaks during executions

> This was an annoying memory leak, which I only discovered thanks to Zig's std.heap.debug_allocator.

> After identifying the leak, I tried to simply free the memory allocated in left and right, but doing so caused double free

Relevant: To be a better programmer, write little proofs in your head | https://news.ycombinator.com/item?id=44573409

When doing things with memory safety you should have obvious and clear memory allocations matched with deallocations that you prove to yourself are matched.

Just vibing memory lifetimes seems super jank.