[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: How to find out current stack size?
- From: "Joshua Jensen" <jjensen@...>
- Date: Mon, 24 Nov 2003 20:15:24 -0700
>> However, I have not seen anything in the Lua reference manual as to
>> check the current stack size. The closest email I've found in the
>> archives is http://lua-users.org/lists/lua-l/2002-
>> 09/msg00163.html, but that doesn't really help me with stack overflow
>> checks.
>
>it's instructive to read the entire thread starting at that message:
>it mentions lua_checkstack() and luaL_checkstack(). also see section
>3.2 (The Stack and Indices) in the reference manual.
If you're into alternative Lua distributions, LuaPlus's LuaObject
(http://wwhiz.com/LuaPlus/index.html) almost completely eliminates Lua stack
management under C++. In addition to that basic functionality, it
implements a solution similar to the one described in the above thread and
autoexpands the stack as needed.
If you're not into non-mainstream Lua distributions, you'll just have to
follow the lua_checkstack() approach above.
Josh