Everybody refers to reference counting as
though it cannot catch cyclic structures.
Rafael Lins, whom I believe is now in the
Departamento de Electronica e Sistemas at
the Universidade de Pernambuco, produced
some beautiful gc reference counting
algorithms that do catch cyclic structures.
See "Cyclic Reference Counting with Lazy
Mark-Scan", UKC Technical Report 75
(1991). I believe he is now a world-expert
on gc, and has co-authored books on the topic.
Seek advice from your eminent compatriots,
ye progenitors of Lua.