[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua C API, coroutines and reference counting
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 13 Jul 2012 11:24:05 -0300
> What happens if the only reference to a coroutine is stored
> in its own stack? Is it going to be garbage collected or not?
>
> struct lua_State *child_L = lua_newthread(L);
> lua_xmove(L, child_L, 1);
It will. For the garbage collector, this is a cycle just like a table
referring itself.
-- Roberto