Re: atexit
- Posted by Michael J. Sabal <m_sabal at yahoo.com> Feb 09, 2006
- 470 views
ChrisBurch2 wrote: > But, I can't help remember reading somewhere that euphoria released all > its memory allocations, and cleaned up itself, when it exited. > > It is good practice to do this explicitly, but this (IMHO) dtracts from > eu's simplicity - you don't have to if you don't want to. To demand that > it be done, is to start to go down C's route of having to do everything > yourself (been there, done that). > > Chris This is one of the things that drove me to Euphoria in the first place (nearly ten years ago now, wow!). I loved that Euphoria cleanly managed its own memory. But even with that, memory leaks are some of the hardest bugs to discover and fix. I have yet to meet a MS product that didn't leak like a rusty bucket. Even some of our most beloved open source projects like Firefox are riddled with memory leaks. By making a habit of freeing anything that's allocated manually, even if Euphoria will take care of it later, is just plain good programming. And with shared libraries, there is no guarantee that the Euphoria interpreter is even aware that the memory was allocated to be able to free it on exit. Michael J. Sabal