4
votes

Is there a way to set a debug hook in Lua for whenever a table is created? I have a fairly complex program and want to see where all the tables are being created so I can optimize and reuse them if possible. Alternatively, is there a way to do this with a metamethod on tables?

1

1 Answers

1
votes

There is no debug hook for that.

You can do a static analysis of your code by searching the output of luac -l for NEWTABLE.