lua-users home
lua-l archive

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


thanks for your help,

but frankly I've not really understood how the weak tables are working

I guess the code I wrote is working for small amounts of data but
I'm not sure of what would happened if several gc occured during the
processing.

> See section 2.9.1 of the manual.  __gc metamethods are
> collected in reverse order of creation, for data that is collected
> in the same gc cycle.  If you additionally want to ensure that one
> userdata will always live at least as long as another, try using
> a weak-keyed/valued table (see section 2.9.2).
>
> --Adam
> --
> Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
> "At this point the rocket becomes engorged with astronauts."
>