Skip to content

Commit cad59fa

Browse files
committed
WIP: Add jit_stack_size option
1 parent 1d3d441 commit cad59fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ngx_http_lua_regex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ ngx_http_lua_ngx_re_match_helper(lua_State *L, int wantcaps)
363363
old_pool = ngx_http_lua_pcre_malloc_init(pool);
364364

365365
sd = pcre_study(re_comp.regex, PCRE_STUDY_JIT_COMPILE, &msg);
366+
pcre_assign_jit_stack(sd, NULL, jit_stack); // reuse the same jit_stack for all regexs
366367

367368
ngx_http_lua_pcre_malloc_done(old_pool);
368369

@@ -825,6 +826,7 @@ ngx_http_lua_ngx_re_gmatch(lua_State *L)
825826
old_pool = ngx_http_lua_pcre_malloc_init(pool);
826827

827828
sd = pcre_study(re_comp.regex, PCRE_STUDY_JIT_COMPILE, &msg);
829+
pcre_assign_jit_stack(sd, NULL, jit_stack); // reuse the same jit_stack for all regexs
828830

829831
ngx_http_lua_pcre_malloc_done(old_pool);
830832

0 commit comments

Comments
 (0)