[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: scripts launching other scripts (coroutines)
- From: "Thomas Blom" <thomasblom@...>
- Date: Thu, 14 Sep 2006 02:32:16 -0500
Thankyou! I now call luaL_ref immediately after the call to lua_newthread
(and no additional push/pops). This serves the dual purpose of preventing
the thread from being GC'd, as well as removing the thread from the
master's stack. I then unref the returned refid when my C++ script object
All appears to be working...
Thomas Blom wrote:
Below is the simplest test I could concoct to repro. There are a few
lua_State * pThread = lua_newthread( master );
From Reference Manual:
Creates a new thread, pushes it on the stack, and returns a pointer
to a lua_State that
represents this new thread.
3.2 - Stack Size
When you interact with Lua API, you are responsible for ensuring
consistency. In particular,
you are responsible for controlling stack overflow. You can use the
to grow the stack size.
So you just overflow master's stack.
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/