diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-05-29 09:39:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-05-29 09:39:03 -0300 |
commit | 44fab2a44d06a956c3121ceba2b39ca7b00dc428 (patch) | |
tree | 9f492ba2ebaa4fb3cf6554fcb63f3fe026d43a5d /lpcode.h | |
parent | 460a35cbcb33fbc56f5a658b96a793b9bb8963e9 (diff) | |
download | lpeg-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.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -12,8 +12,8 @@ int checkaux (TTree *tree, int pred); | |||
12 | int fixedlen (TTree *tree); | 12 | int fixedlen (TTree *tree); |
13 | int hascaptures (TTree *tree); | 13 | int hascaptures (TTree *tree); |
14 | int lp_gc (lua_State *L); | 14 | int lp_gc (lua_State *L); |
15 | Instruction *compile (lua_State *L, Pattern *p); | 15 | Instruction *compile (lua_State *L, Pattern *p, uint size); |
16 | void realloccode (lua_State *L, Pattern *p, int nsize); | 16 | void freecode (lua_State *L, Pattern *p); |
17 | int sizei (const Instruction *i); | 17 | int sizei (const Instruction *i); |
18 | 18 | ||
19 | 19 | ||