[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: dawn of the dead: dead coroutine as a key in a __mode="v" table
- From: Mike Pall <mikelu-0611@...>
- Date: Fri, 17 Nov 2006 00:42:07 +0100
Karel Tuma wrote:
> as you can see, there is something wrong with this. the "dead"
> coroutine makes "strong" reference to 'a' but there is no way
> to kill that reference in the first place. i'd understand this
> if it would be open upvalue, or the coroutine alive, but come on,
> what's purpose of completely dead coroutine's stack making strong
> references to my weak values?
Dead coroutines hold onto their stack because this is the only
way to get a backtrace if coroutine.resume() returns an error.
> solution to this should be simple: ignore references from dead
> coroutine's stack, i'm now trying to figure out how to hack this
> into lua's gc (which is the most mysterious part of lua for me :)
This is not difficult. Check L->status before marking the stack
in traversestack(). But ...
> the question is: will this break something?
Yes, see above.