lua-users home
lua-l archive

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


> Another solution is to keep the current global weak table, but to add
> another table only to control the indices. This table is strong, and
> associates indices being used to true. When a new userdata creates a
> new index, it queries this table to check for a free index. Only when
> a userdata finalizes, it removes its corresponding index from this table,
> and only then that index can be reused.

Roberto,

Thanks for your help. I ended up doing what you suggested above and it is
sufficient.