lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Roberto wrote:
In several "common" platforms (such as most Unixes and Windows) you
get nothing by closing the state, as all resorces (memory and file
descriptors) are automatically released by the system when the program
ends.

On the other hand, closing a large state takes some time, as Lua has to
release all memory it was using.
It is possible that a Lua program grabs some resource that is not 
automatically released (for example video memory, or the semaphore to 
the robot attached to your USB port).  Even though I wrote my program 
correctly to free allocated resources, I need to worry about specifying 
the -c option.
It seems backwards.  Why not treat "not closing state" as a special 
optimization that must be explicitly requested?  (Still, I can't believe 
it will make a noticeable difference in your average app.)
-John



--
OpenPGP encrypted mail welcome.