MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaE_shrinkCI

Function luaE_shrinkCI

third-party/lua-5.5.0/src/lstate.c:104–121  ·  view source on GitHub ↗

** free half of the CallInfo structures not in use by a thread, ** keeping the first one. */

Source from the content-addressed store, hash-verified

102** keeping the first one.
103*/
104void luaE_shrinkCI (lua_State *L) {
105 CallInfo *ci = L->ci->next; /* first free CallInfo */
106 CallInfo *next;
107 if (ci == NULL)
108 return; /* no extra elements */
109 while ((next = ci->next) != NULL) { /* two extra elements? */
110 CallInfo *next2 = next->next; /* next's next */
111 ci->next = next2; /* remove next from the list */
112 L->nci--;
113 luaM_free(L, next); /* free next */
114 if (next2 == NULL)
115 break; /* no more elements */
116 else {
117 next2->previous = ci;
118 ci = next2; /* continue */
119 }
120 }
121}
122
123
124/*

Callers 1

luaD_shrinkstackFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected