From 4e47f81188d37e29027158b76271d02a781242e2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 9 Feb 2021 14:00:05 -0300 Subject: New implementation for to-be-closed variables To-be-closed variables are linked in their own list, embedded into the stack elements. (Due to alignment, this information does not change the size of the stack elements in most architectures.) This new list does not produce garbage and avoids memory errors when creating tbc variables. --- lstate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 5ef55355..b6ade7c7 100644 --- a/lstate.h +++ b/lstate.h @@ -307,6 +307,7 @@ struct lua_State { StkId stack_last; /* end of stack (last element + 1) */ StkId stack; /* stack base */ UpVal *openupval; /* list of open upvalues in this stack */ + StkId tbclist; /* list of to-be-closed variables */ GCObject *gclist; struct lua_State *twups; /* list of threads with open upvalues */ struct lua_longjmp *errorJmp; /* current error recover point */ @@ -318,7 +319,6 @@ struct lua_State { int basehookcount; int hookcount; volatile l_signalT hookmask; - StkId ptbc; /* pending to-be-closed variable */ }; -- cgit v1.2.3-55-g6feb