MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / checkstacksizes

Function checkstacksizes

Source/Misc/lua/src/lua.c:6243–6255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6241
6242
6243static void checkstacksizes (lua_State *L, StkId max) {
6244int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */
6245int s_used = cast_int(max - L->stack); /* part of stack in use */
6246if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */
6247return; /* do not touch the stacks */
6248if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
6249luaD_reallocCI(L, L->size_ci/2); /* still big enough... */
6250condhardstacktests(luaD_reallocCI(L, ci_used + 1));
6251if (4*s_used < L->stacksize &&
62522*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)
6253luaD_reallocstack(L, L->stacksize/2); /* still big enough... */
6254condhardstacktests(luaD_reallocstack(L, s_used));
6255}
6256
6257
6258static void traversestack (global_State *g, lua_State *l) {

Callers 1

traversestackFunction · 0.85

Calls 2

luaD_reallocCIFunction · 0.85
luaD_reallocstackFunction · 0.85

Tested by

no test coverage detected