[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Boxed userdata and garbage collector
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 3 Sep 2010 10:39:50 -0300
> I am facing in fact the same situation than with OpenCV : i would
> like to avoid modifying the C library itself.
> Up the now, i think that the easiest solution (even if not 100%
> perfect) is the proposal of Roberto (ie calling the lua_gc(STEP, x)
> during picture allocation to 'speedup' the gc).
> At the end, and after reading all your contributions, i think that
> the perfect solution still remains the integration of 2 new actions
> in the lua_gc call, allowing to increase/decrease externally the LUA
> internal memory counter.
With the current incremental garbage collector, the collector is moved
forward by allocations, that is, deltas in 'totalbytes', not by its
absolute value. (The only effect that the absolute value of 'totalbytes'
has on the collector speed is to make the collector slower, increasing
the pause between collection cycles.)
So, to mimic the effect of an external allocation as if it were
internal, lua_gc(STEP, x) seems to be more than enough. I do not
think there is a need for extra API.
-- Roberto
- References:
- 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
- Re: Boxed userdata and garbage collector, Ted Unangst
- Re: Boxed userdata and garbage collector, Michal Kottman
- Re: Boxed userdata and garbage collector, Sylvain Fabre