Skip to content

Commit e88323b

Browse files
committed
Add ngx.re.opt with a "jit_stack_size" option
1 parent a51e5f8 commit e88323b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/resty/core/regex.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ ffi.cdef[[
135135
unsigned char *dst);
136136

137137
uint32_t ngx_http_lua_ffi_max_regex_cache_size(void);
138+
139+
void ngx_http_lua_ffi_set_jit_stack_size(int size);
140+
138141
]]
139142

140143

@@ -162,6 +165,11 @@ local function get_max_regex_cache_size()
162165
return max_regex_cache_size
163166
end
164167

168+
function ngx.re.opt(option, value)
169+
if option == "jit_stack_size" then
170+
C.ngx_http_lua_ffi_set_jit_stack_size(value)
171+
end
172+
end
165173

166174
local function parse_regex_opts(opts)
167175
local t = cached_re_opts[opts]

0 commit comments

Comments
 (0)