-c option to lua standalone

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

-c option to lua standalone

Reuben Thomas-3
What's the point of this? Since the program immediately exits anyway after
calling lua_close, it's not obvious what effect this could have.

-- 
http://sc3d.org/rrt/
"In 1727, Helen Morrison, a lonely spinster, became the first woman to
place a Lonely Hearts advertisement. It appeared in the Manchester Weekly
Journal. The mayor promptly committed her to a lunatic asylum for four
weeks." - The People's Almanac #2


Reply | Threaded
Open this post in threaded view
|

Re: -c option to lua standalone

Roberto Ierusalimschy
> What's the point of this? Since the program immediately exits anyway after
> calling lua_close, it's not obvious what effect this could have.

Some OS have problems with programs that do not deallocate their memory. 
Also, lua_close will call the GC tag method for all userdata in the 
program; if you are using extensions, that may free other resorces as well. 
On the other hand, to always call lua_close can be quite expensive for
systems that do not need that.

(it also helps a lot for testing ;-)

-- Roberto