From ba7da13ec5938f978c37d63aa40a3e340b301f79 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 27 Dec 2018 14:32:29 -0200 Subject: Changes in the control of C-stack overflow * unification of the 'nny' and 'nCcalls' counters; * external C functions ('lua_CFunction') count more "slots" in the C stack (to allow for their possible use of buffers) * added a new test script specific for C-stack overflows. (Most of those tests were already present, but concentrating them in a single script easies the task of checking whether 'LUAI_MAXCCALLS' is adequate in a system.) --- luaconf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index ff708513..0fc161a4 100644 --- a/luaconf.h +++ b/luaconf.h @@ -695,14 +695,14 @@ /* @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. ** CHANGE it if it uses too much C-stack space. (For long double, -** 'string.format("%.99f", -1e4932)' needs 5034 bytes, so a +** 'string.format("%.99f", -1e4932)' needs 5052 bytes, so a ** smaller buffer would force a memory allocation for each call to ** 'string.format'.) */ #if LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE #define LUAL_BUFFERSIZE 8192 #else -#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) +#define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) #endif /* -- cgit v1.2.3-55-g6feb