Improvements in the handling of signals

Added 'volatile' to 'l_signalT' variables plus some minor changes.
This commit is contained in:
Roberto Ierusalimschy
2020-05-22 11:40:34 -03:00
parent 9514abc2da
commit 17dbaa8639
5 changed files with 25 additions and 21 deletions

View File

@@ -190,14 +190,15 @@ void luaE_freeCI (lua_State *L) {
*/
void luaE_shrinkCI (lua_State *L) {
CallInfo *ci = L->ci;
CallInfo *next;
CallInfo *next2; /* next's next */
L->nCcalls += L->nci; /* add removed elements back to 'nCcalls' */
/* while there are two nexts */
while (ci->next != NULL && (next2 = ci->next->next) != NULL) {
luaM_free(L, ci->next); /* free next */
L->nci--;
ci->next = next2; /* remove 'next' from the list */
while ((next = ci->next) != NULL && (next2 = next->next) != NULL) {
ci->next = next2; /* remove next from the list */
next2->previous = ci;
luaM_free(L, next); /* free next */
L->nci--;
ci = next2; /* keep next's next */
}
L->nCcalls -= L->nci; /* adjust result */