MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaE_shrinkCI

Function luaE_shrinkCI

libraries/AP_Scripting/lua/src/lstate.c:145–156  ·  view source on GitHub ↗

** free half of the CallInfo structures not in use by a thread */

Source from the content-addressed store, hash-verified

143** free half of the CallInfo structures not in use by a thread
144*/
145void luaE_shrinkCI (lua_State *L) {
146 CallInfo *ci = L->ci;
147 CallInfo *next2; /* next's next */
148 /* while there are two nexts */
149 while (ci->next != NULL && (next2 = ci->next->next) != NULL) {
150 luaM_free(L, ci->next); /* free next */
151 L->nci--;
152 ci->next = next2; /* remove 'next' from the list */
153 next2->previous = ci;
154 ci = next2; /* keep next's next */
155 }
156}
157
158
159static void stack_init (lua_State *L1, lua_State *L) {

Callers 1

luaD_shrinkstackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected