[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Boxed userdata and garbage collector
- From: Jonathan Castello <twisolar@...>
- Date: Thu, 2 Sep 2010 12:49:08 -0700
On Thu, Sep 2, 2010 at 12:14 PM, Sylvain Fabre
> This is an option too, but in that case, i need to know wich objects are
> marked as 'free' from the LUA engine. An right now, i do not know if there
> is a way to achieve this.
Have you looked into the __gc metamethod that you can use on full
userdata? It's called when the Lua GC is collecting that userdatum,
and it's good for releasing attached memory in C, decrementing
refcounts, closing file descriptors, and so on.