16 pointsby gilgamesh34 days ago2 comments
  • pjmlp3 days ago
    Basically,

    "CRT debug heap details"

    https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-...

    This is why I mention these new languages are expected to bring new tools, not recycle what we already have in C and C++.

  • kingstnap4 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.