Reputation: 3643
The Lua docs say
When a program has no references to a table left, Lua memory management will eventually delete the table and reuse its memory.
My question is : Is it possible to count the no of references to a particular table during runtime?
Upvotes: 3
Views: 2026
Reputation: 72312
You can find all references to a Lua value using the debug library. See these messages:
The luatraverse library found in the below link solves this nicely! http://code.matthewwild.co.uk/luatraverse/summary
Upvotes: 5