aboutsummaryrefslogtreecommitdiff
path: root/lptree.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-07 15:41:01 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-07 15:41:01 -0300
commitcf1705c1d96b549ef5887a2bc3038dbc31912e50 (patch)
tree98d37b61c4f095b089fa40e55032e0479932be6c /lptree.c
parente31e13f59ef1a4df1698b15ff1fe0198553cc3c2 (diff)
downloadlpeg-cf1705c1d96b549ef5887a2bc3038dbc31912e50.tar.gz
lpeg-cf1705c1d96b549ef5887a2bc3038dbc31912e50.tar.bz2
lpeg-cf1705c1d96b549ef5887a2bc3038dbc31912e50.zip
Captures point to string positions using indices
That uses 4 bytes (uint) instead of 8 (char*); the size of the structure 'Capture' reduces from 16 to 8 bytes in 64-bit machines.
Diffstat (limited to 'lptree.c')
-rw-r--r--lptree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lptree.c b/lptree.c
index 330471a..475b0c3 100644
--- a/lptree.c
+++ b/lptree.c
@@ -1253,6 +1253,7 @@ static int lp_match (lua_State *L) {
1253 const char *s = luaL_checklstring(L, SUBJIDX, &l); 1253 const char *s = luaL_checklstring(L, SUBJIDX, &l);
1254 size_t i = initposition(L, l); 1254 size_t i = initposition(L, l);
1255 int ptop = lua_gettop(L); 1255 int ptop = lua_gettop(L);
1256 luaL_argcheck(L, l < MAXINDT, SUBJIDX, "subject too long");
1256 lua_pushnil(L); /* initialize subscache */ 1257 lua_pushnil(L); /* initialize subscache */
1257 lua_pushlightuserdata(L, capture); /* initialize caplistidx */ 1258 lua_pushlightuserdata(L, capture); /* initialize caplistidx */
1258 lua_getuservalue(L, 1); /* initialize ktableidx */ 1259 lua_getuservalue(L, 1); /* initialize ktableidx */