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