From 8b7cfee26b71e66de2cef9f8db9d9e18f5439afd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 26 Jun 2019 13:26:36 -0300 Subject: Small changes around C-stack limit - Better documentation in 'testes/cstack.lua' about using 'debug.setCstacklimit' to find a good limit. - Constant LUAI_MAXCSTACK gets added CSTACKERR (extra stack for error handling), so that it is compatible with the argument to 'debug.setCstacklimit'. --- lstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 92d5165a..d4bc53eb 100644 --- a/lstate.c +++ b/lstate.c @@ -388,7 +388,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { preinit_thread(L, g); g->allgc = obj2gco(L); /* by now, only object is the main thread */ L->next = NULL; - g->Cstacklimit = L->nCcalls = LUAI_MAXCSTACK; + g->Cstacklimit = L->nCcalls = LUAI_MAXCSTACK + CSTACKERR; g->frealloc = f; g->ud = ud; g->warnf = NULL; -- cgit v1.2.3-55-g6feb