[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Module finalization (along the lines of calling a function onexit)
- From: "Vijay Aswadhati" <wyseman@...>
- Date: Fri, 19 Aug 2005 09:51:35 -0700
> On August 19, 2005, Rici Lake wrote:
>
> In 5.1, CFunctions will have an environment table just like Lua
> functions. So that could be assigned to the package table. (In fact, I
> think the 5.1 loadlib system does exactly that. It certainly seems to
> have a dynamic unloading __gc method, at least on some OS's.)
I am using 5.1(work6). Since the native library that I am working on is all 'C'
I am interested in any benefits this environment table provides and eventually
in resolving my originaly problem any more naturaly if possible.
Could you please explain how this environment table could be used?
> But I'm still not convinced that unloading dynamic modules is a good
> idea.
Just to be sure, I do not want to unload my module. My module needs an exit
hook regardless of whether it way unloaded explicitly or implicitly (say due to
lua_close()).
As I was writing this maybe my answer is to use the 'C' atexit() function which
is available in most systems. Hmmm.
Vijay Aswadhati