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. --- lobject.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 470b17d5..1a7a7372 100644 --- a/lobject.h +++ b/lobject.h @@ -136,10 +136,18 @@ typedef struct TValue { /* -** Entries in the Lua stack +** Entries in a Lua stack. Field 'tbclist' forms a list of all +** to-be-closed variables active in this stack. Dummy entries are +** used when the distance between two tbc variables does not fit +** in an unsigned short. */ typedef union StackValue { TValue val; + struct { + TValuefields; + lu_byte isdummy; + unsigned short delta; + } tbclist; } StackValue; -- cgit v1.2.3-55-g6feb