[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Userdata example for 5.2.2
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 18 Apr 2013 20:37:01 -0300
> There doesn't seem to be a "__gc" call though- would I be correct in
> assuming that it isn't there as MT doesn't really need specific cleanup
> during garbage collection?
Yes. Anyone using MT must provide a struct to it. lrandom uses
lua_newuserdata to allocate one; this memory is fully managed by Lua.
OTOH, lgdbm uses handles provided by gdbm and so must register a gc method
for closing the databases when the handle is collected in Lua.