Finally I have a valid reason to learn about memory management. It was also hella weird when encountering it.

  • henfredemars@infosec.pub
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 days ago

    Absolutely. I once wrote a server for a factory machine that spawned child processes to work each job item. Intentionally we did not free any memory in the child process because it serves only one request and then exits anyway. It’s much more efficient to have the OS just clean up everything and provides strong guarantees that nothing can be left behind accidentally for a system where up time was money. Any code to manage memory was pointless line noise and extra developer effort.

    In fact I think in the linker we specifically replaced free with a function that does nothing.