[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Thoughts on lua_checkstack() implicit usage
- From: Arseny Vakhrushev <arseny.vakhrushev@...>
- Date: Sat, 22 Oct 2011 15:11:04 +0400
On Oct 21, 2011, at 19:32 , Peter Cawley wrote:
> On Fri, Oct 21, 2011 at 4:00 PM, Arseny Vakhrushev
> <email@example.com> wrote:
>> I am totally comfortable with checking the stack gap. However, it should be explicitly documented how much stack size I need prior to making library calls which use the stack implicitly. Otherwise, it may lead to very rare and subtle error cases.
> It is documented in the 5.2 reference manual:
> "Several functions in the auxiliary library use internally some extra
> stack slots. When a function in the auxiliary library uses less than
> five slots, it does not check the stack size; it simply assumes that
> there are enough slots. " - http://www.lua.org/work/doc/manual.html#5
That's fair enough. Thanks for noting! However, I didn't find anything like this in the Lua 5.1 manual. Anyway, I suppose this policy can be easily applied for Lua 5.1 as well.