lua-users home
lua-l archive

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

> How can I know (in Lua 4.0) about currently allocated memory and space
> remaining before the next GC happens? (or equivalent info)

`lua_getgccount' returns the number of Kbytes currently allocated by Lua.
`lua_setgcthreshold' returns the number of Kbytes "available" until the
next GC cycle (that is, when lua_getgccount() >= lua_setgcthreshold(),
Lua triggers the GC).  (In Lua both values are returned by `gcinfo').

-- Roberto