lua-users home
lua-l archive

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


on 2/13/06 3:50 PM, David Given at dg@cowlark.com wrote:

> The thing is, *why* am I getting this error? I am not doing what it says I'm
> doing. I have a C function that's calling into Lua, which is shuffling pure
> Lua coroutines and occasionally calls non-reentrant C functions, and then
> exits back to the calling C function. That's it. I am *not* trying to yield
> across a C boundary that I am aware of.

Your C code may need to use lua_resume rather than lua_call. Of course, then
it needs to work in terms of coroutines rather than functions.

You may also be getting bitten somewhere by pcall being a C function. I
suspect that this is the most common place where C code slips onto the stack
unnoticed and if Lua 5.2 doesn't address the issue wholesale, I would hope
that we could find a solution specifically for pcall.

Mark