lua-users home
lua-l archive

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


On Wed, 26 May 2010 15:55:23 +0300, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

Is it safe to trigger EGC by returning 0 once from allocation function?

Sure, as long as the call is actually trying to allocate memory (that
is, newsize > oldsize). The allocation function should never fail when
freeing memory (newsize <= oldsize).


Thanks!

Just tried, and it really works. With my generational gc test code,
maximum collectgarbage("count") value is actually _higher_ (also
the TRACEMEM shows higher value), even though the resident set size,
reported by time -v is lower.

What exactly does the value of collectgarbage("count") mean?