lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> For example, a call to collectgarbage( "step", n ) will slam right
> over the top of this.

If someone is crazy enough to do that call inside a finalizer, then
why not let his wish come true?

> On a related note from looking at the code, I have to say that LUA_GCSTEP
> doesn't do what I would have thought it would have done. I would have
> expected it to run things forward as if a certain amount of memory had been
> allocated -- i.e., as if totalbytes had been driven up. Or alternatively, it
> could have lowered the threshold by the step amount. Instead, it sets the
> threshold based on the step. Doesn't this mean that calls to "step"
> essentially throw the garbage collector into fully-active mode since the
> threshold will now be less than totalbytes?

Actually the `n' argument is not working properly, but in the other
direction, it seems. A call to LUA_GCSTEP does roughly one GC "step", no
matter `n'. (A quick test took some 350 step calls to perform a full GC

-- Roberto