diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-06-07 15:41:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-06-07 15:41:01 -0300 |
commit | cf1705c1d96b549ef5887a2bc3038dbc31912e50 (patch) | |
tree | 98d37b61c4f095b089fa40e55032e0479932be6c /lptree.c | |
parent | e31e13f59ef1a4df1698b15ff1fe0198553cc3c2 (diff) | |
download | lpeg-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 */ |