MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaE_shrinkCI

Function luaE_shrinkCI

3rd/lua-5.4.3/src/lstate.c:138–155  ·  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

136** keeping the first one.
137*/
138void luaE_shrinkCI (lua_State *L) {
139 CallInfo *ci = L->ci->next; /* first free CallInfo */
140 CallInfo *next;
141 if (ci == NULL)
142 return; /* no extra elements */
143 while ((next = ci->next) != NULL) { /* two extra elements? */
144 CallInfo *next2 = next->next; /* next's next */
145 ci->next = next2; /* remove next from the list */
146 L->nci--;
147 luaM_free(L, next); /* free next */
148 if (next2 == NULL)
149 break; /* no more elements */
150 else {
151 next2->previous = ci;
152 ci = next2; /* continue */
153 }
154 }
155}
156
157
158/*

Callers 1

luaD_shrinkstackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected