From 44fab2a44d06a956c3121ceba2b39ca7b00dc428 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 29 May 2023 09:39:03 -0300 Subject: Code size stored in code itself Most patterns do not have code, as they are not directly used for a match; they are created only to compose larger patterns. So, we shouldn't waste space to store the size of their code, as a NULL pointer already indicates that the size is zero. --- lpcode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lpcode.h') diff --git a/lpcode.h b/lpcode.h index 3c71451..10c2ced 100644 --- a/lpcode.h +++ b/lpcode.h @@ -12,8 +12,8 @@ int checkaux (TTree *tree, int pred); int fixedlen (TTree *tree); int hascaptures (TTree *tree); int lp_gc (lua_State *L); -Instruction *compile (lua_State *L, Pattern *p); -void realloccode (lua_State *L, Pattern *p, int nsize); +Instruction *compile (lua_State *L, Pattern *p, uint size); +void freecode (lua_State *L, Pattern *p); int sizei (const Instruction *i); -- cgit v1.2.3-55-g6feb