[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boxed userdata and garbage collector
- From: Ted Unangst <ted.unangst@...>
- Date: Thu, 2 Sep 2010 16:58:14 -0400
On Thu, Sep 2, 2010 at 4:47 PM, Peter Cawley <lua@corsix.org> wrote:
> My proposal is that the current image-related code is taken, and then
> the calls to malloc/free which deal with the large buffer are replaced
> with calls to some generic allocator. Then the above Lua-based
> allocator is used as the generic allocator, meaning that the garbage
> collector is aware that there is this large block of memory floating
> around. This causes the Lua GC to run collections at better intervals,
> which should cause the proper image userdata to be collected. In turn,
> the __gc method on the proper userdata will eventually call the
> generic free function on its large buffer, which calls the lua
> allocator free function, which causes the large buffer to be garbage
> collected in the next cycle.
Very interesting. Thanks, that's a consequence I hadn't thought of.
- References:
- Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Florian Weimer
- Re: Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Jonathan Castello
- Re: Boxed userdata and garbage collector, Sylvain Fabre
- Re: Boxed userdata and garbage collector, Jonathan Castello
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Peter Cawley
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Peter Cawley