lua-users home
lua-l archive

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


Ah thanks again :)

On Mon, Jun 17, 2019 at 7:54 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> By enabling the API checks you mean these lines in lapi.h? :
>
> #define api_incr_top(L)   {L->top++; api_check(L->top <= L->ci->top, \
> "stack overflow");}
>
> #define adjustresults(L,nres) \
>     { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top =
> L->top; }
>
> #define api_checknelems(L,n) api_check((n) < (L->top - L->ci->func), \
>  "not enough elements in the stack")

He probably means this lines in luaconf.h:

/*
@@ LUA_USE_APICHECK turns on several consistency checks on the C API.
** Define it as a help when debugging C code.
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(l,e)      assert(e)
#endif

You only have to define LUA_USE_APICHECK.

-- Roberto