lua-users home
lua-l archive

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


 > > Is it easy to change the ratio that Lua maintains between the size
 > > of the heap and the amount of live data at the last collection?
 > 
 > Just change the `2' in
 > 
 >     L->GCthreshold = (limit == 0) ? 2*L->nblocks : L->nblocks+limit;
 > 
 > at lgc.c:265 (Version 3.2).
 > 
 > (`GCthreshold' is the "size of the heap", `nblocks' is "the amount of live 
 > data". `limit' is always 0 when Lua starts GC.) 

May I suggest that in a future version, this `2' be a Lua global
variable, or at least settable from Lua code?


Norman