aka “bros: in order to be rich, just don’t be poor.”

  • moonpiedumplings@programming.dev
    link
    fedilink
    arrow-up
    27
    ·
    2 days ago

    No, this is kinda right. Memory leaks =/= memory safety. Memory leaks are just when you keep allocating more and more memory, and can be done in any language. If I make accidentally make a list that infinitely grows in python, that’s a memory leak.

    There are techniques to write code that is mostly free of leaks, which is what he is referring to.

    Memory safety, on the other hand, doesn’t seem to be mentioned on that page…

    • BradleyUffner@lemmy.world
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      23 hours ago

      A “true” memory leak isn’t just memory that is never freed, it’s memory that CAN’T be freed. Usually because the handle / pointer to it was thrown away.

      The distinction isn’t really all the important though, it all looks the same as far as how the program functions.