lua-users home
lua-l archive

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

2007/11/21, Matt Campbell <>:
Lua never copies full userdata; it only creates more references to them.
  It does copy light userdata, but light userdata are just pointers, and
probably not what you're asking about.


Uh, sorry, one last thing.
I imagine that if no __gc metamethods is given to userdata, as you showed, the garbage collector never collects the "local" references to that class throughout the scripts, is that correct ?
And that could also cause memory leaks...along with memory corruptions and so on (?!)
I'm asking because in some circumstances I found "garbage" instead of the table I passed as a parameter from Lua to a C++ class.
(currently using Luna for C++ wrapping)

Thanks again.