[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Acceptable indicies
- From: liam mail <liam.list@...>
- Date: Tue, 30 Aug 2011 16:10:34 +0100
On 30 August 2011 15:58, Robert Raschke <email@example.com> wrote:
> On Tue, Aug 30, 2011 at 3:52 PM, Robert Raschke <firstname.lastname@example.org>
>> On Tue, Aug 30, 2011 at 3:22 PM, oliver <email@example.com>
>>>> Would it be correct to say, "all functions which take a stack index
>>>> require that it is inside the available stack space",
>>>> or when stackspace equals X
>>>> luaL_checkany(L,X+1) is undefined.
>>> BTW, is there a way of knowing "available stack space"? Alternately a
>>> "bool lua_isacceptable(L, index)" would be a nice function to have.
>> int lua_checkstack(lua_State *L, int extra);
> Actually, on reflection that's not exactly what you're asking for. But
> lua_gettop (http://www.lua.org/manual/5.1/manual.html#lua_gettop) gets you
> the size of the stack. So these two give you what you need, or not?
The only way that I know of to find the size of the stack space, is to
use the member of lua_State which is not part of the API.