@@ -1926,10 +1926,27 @@ ngx_http_lua_ngx_re_sub_helper(lua_State *L, unsigned global)
1926
1926
}
1927
1927
1928
1928
1929
+ void
1930
+ ngx_http_lua_set_jit_stack_size (int size )
1931
+ {
1932
+ ngx_http_lua_main_conf_t * lmcf ;
1933
+
1934
+ if (size < NGX_LUA_RE_MIN_JIT_STACK_SIZE ) {
1935
+ size = NGX_LUA_RE_MIN_JIT_STACK_SIZE ;
1936
+ }
1937
+
1938
+ lmcf = ngx_http_cycle_get_module_main_conf (ngx_cycle ,
1939
+ ngx_http_lua_module );
1940
+ // pcre_jit_stack_free(lmcf->jit_stack); // Y U NO WORK?
1941
+ lmcf -> jit_stack = pcre_jit_stack_alloc (NGX_LUA_RE_MIN_JIT_STACK_SIZE ,
1942
+ size );
1943
+ }
1944
+
1945
+
1929
1946
static int
1930
1947
ngx_http_lua_ngx_re_opt (lua_State * L )
1931
1948
{
1932
- ngx_str_t option ;
1949
+ const char * option ;
1933
1950
int nargs ;
1934
1951
int value = 0 ;
1935
1952
@@ -1938,10 +1955,10 @@ ngx_http_lua_ngx_re_opt(lua_State *L)
1938
1955
return luaL_error (L , "expecting two arguments, but got %d" , nargs );
1939
1956
}
1940
1957
1941
- option . data = ( u_char * ) luaL_checklstring (L , 1 , & option . len );
1958
+ option = luaL_checklstring (L , 1 , NULL );
1942
1959
value = luaL_checkint (L , 2 );
1943
1960
1944
- if (strcmp (option . data , "jit_stack_size" ) == 0 ) {
1961
+ if (strcmp (option , "jit_stack_size" ) == 0 ) {
1945
1962
ngx_http_lua_set_jit_stack_size (value );
1946
1963
}
1947
1964
@@ -2515,23 +2532,6 @@ ngx_http_lua_ffi_max_regex_cache_size(void)
2515
2532
#endif /* NGX_LUA_NO_FFI_API */
2516
2533
2517
2534
2518
- void
2519
- ngx_http_lua_set_jit_stack_size (int size )
2520
- {
2521
- ngx_http_lua_main_conf_t * lmcf ;
2522
-
2523
- if (size < NGX_LUA_RE_MIN_JIT_STACK_SIZE ) {
2524
- size = NGX_LUA_RE_MIN_JIT_STACK_SIZE ;
2525
- }
2526
-
2527
- lmcf = ngx_http_cycle_get_module_main_conf (ngx_cycle ,
2528
- ngx_http_lua_module );
2529
- // pcre_jit_stack_free(lmcf->jit_stack); // Y U NO WORK?
2530
- lmcf -> jit_stack = pcre_jit_stack_alloc (NGX_LUA_RE_MIN_JIT_STACK_SIZE ,
2531
- size );
2532
- }
2533
-
2534
-
2535
2535
#endif /* NGX_PCRE */
2536
2536
2537
2537
/* vi:set ft=c ts=4 sw=4 et fdm=marker: */
0 commit comments