lua-users home
lua-l archive

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


>> One trick to avoiding this problem is create as few new tables as possible
in your program - since it's the tables that are garbage collected. For
instance, if
you're doing vector math with tables like:  newtable = table1:add_(table2)
Instead of creating an returning a new table, have the operation apply to
the first table:  table1 = table1:add_(table2)

Just to clarify. Is it only the table which are collected? What about numbers,
functions and user objects? Are these not collected until a lua_close()?

In the event of function redefinition say,

function x()
    print (5)
end

 x = function()
    print(6)
end

Will the first x be collected since the reference count is 0?

N