[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and C++ memory
- From: "Pixel Pusher" <pixpush@...>
- Date: Wed, 21 Nov 2007 03:14:44 +0100
2007/11/21, Matt Campbell <mattcampbell@pobox.com>:
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.
Matt
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.