[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: question about alien library unloading
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Fri, 24 Sep 2010 20:27:54 -0300
On Fri, Sep 24, 2010 at 7:23 PM, Cosmin Apreutesei
> I think I found the problem with second issue. All loaded libraries
> share the same metatable, the global ALIEN_LIBRARY_META, of which
> __index = a closure with one upvalue, which is a table in which every
> function is cached by name only. So to solve the problem, either cache
> functions by libname.funcname or let each library have its own
> metatable inheriting from ALIEN_LIBRARY_META, and change
> alien_checklibrary() accordingly.
I will store the cache in the library userdata's environment, and will
also put a backlink there so alien.loaded can be a weak table, and
kill two birds with one stone.
Thanks for raising these issues!