lua-users home
lua-l archive

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

> Roberto will probably post more details on what we need.

As lhf pointed out, the main purpose of this release is to start an
evaluation of the incremental GC. It is up and running, but there
are lots of work to be done.

First, we need to know whether it is incremental enough for people that
need an incremental GC. We can only find this by tests with actual

Second, we need more tests for bugs. We eliminated all bugs that we found,
but among the bugs that can flourish in such collector there are several
that are quite hard to appear.

A big question that remains is how to control the pace of the collector.
If the collector runs to fast, it wastes time; if it runs too slow, it
wastes memory. Again, we need real data to better understand this point.

There is a single function to control GC, with an argument that tells
what to do. (We chose that design because we have no idea what the final
options would be.)

  lua_gc(L, LUA_GCSTOP, 0)       --> stops the collector
  lua_gc(L, LUA_GCRESTART, 0)    --> restart
  lua_gc(L, LUA_GCCOLLECT, 0)    --> perform a whole collection
  lua_gc(L, LUA_GCCOUNT, 0)      --> returns number of bytes allocated

You can do the same in Lua:

  collectgarbage("collect")  (equivalent to collectgarbage())

-- Roberto