[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: coroutines local userdata and GC
- From: arioch82 <arioch82@...>
- Date: Tue, 18 Nov 2014 12:41:47 -0700 (MST)
that's my understanding as well.
I was thinking that the problem could be that since functions are first
class values, having the function defined in a module like the
"coroutine_update" in the snippet actually means keeping a reference to that
function.
Now when I run coroutine.create(coroutine_update) i am actually adding a
reference to the same function through the coroutine so even if the
coroutine is collected the function will still be referenced through the
"coroutine_update" variable in the module, therefore the local userdata will
never be garbage collected.
But i am not sure if the way i think function values are referenced is
correct, maybe they are "instanced" when referenced by coroutines?
If someone could shred some light on this it would be great.
--
View this message in context: http://lua.2524044.n2.nabble.com/coroutines-local-userdata-and-GC-tp7664107p7664131.html
Sent from the Lua-l mailing list archive at Nabble.com.