lua-users home
lua-l archive

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


Hi all

I've got a problem trying to use weak-referenced tables. While they perform as described, it's not quite what I had hoped for. The problem is really that entries in such a table (be it weak-keyed or weak-valued) remain accessible until the underlying object is marked (or unmarked ??) by a GC cycle.

So, my questions are:

1) is it possible to force the GC to just mark an object (or unmark it ??) without running a full GC cycle ? 2) if the answer to 1) above is yes, then is it possible for table keys/values to 'hide' the table entry if their underlying object has been marked to die ? Currently, is seems that such tables will only remove entries as part of a GC cycle.

Apologies in advance on my ignorance of the Lua GC.

Lawrie