aboutsummaryrefslogtreecommitdiff
path: root/lpcode.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-05-29 09:39:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-05-29 09:39:03 -0300
commit44fab2a44d06a956c3121ceba2b39ca7b00dc428 (patch)
tree9f492ba2ebaa4fb3cf6554fcb63f3fe026d43a5d /lpcode.h
parent460a35cbcb33fbc56f5a658b96a793b9bb8963e9 (diff)
downloadlpeg-44fab2a44d06a956c3121ceba2b39ca7b00dc428.tar.gz
lpeg-44fab2a44d06a956c3121ceba2b39ca7b00dc428.tar.bz2
lpeg-44fab2a44d06a956c3121ceba2b39ca7b00dc428.zip
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.
Diffstat (limited to 'lpcode.h')
-rw-r--r--lpcode.h4
1 files changed, 2 insertions, 2 deletions
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);
12int fixedlen (TTree *tree); 12int fixedlen (TTree *tree);
13int hascaptures (TTree *tree); 13int hascaptures (TTree *tree);
14int lp_gc (lua_State *L); 14int lp_gc (lua_State *L);
15Instruction *compile (lua_State *L, Pattern *p); 15Instruction *compile (lua_State *L, Pattern *p, uint size);
16void realloccode (lua_State *L, Pattern *p, int nsize); 16void freecode (lua_State *L, Pattern *p);
17int sizei (const Instruction *i); 17int sizei (const Instruction *i);
18 18
19 19