diff src/core/ngx_regex.h @ 4388:005fc2d5e84f

Added support for regex study and PCRE JIT (ticket #41) optimizations on configuration phase.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 26 Dec 2011 13:10:36 +0000
parents 42c16d8bddbe
children d620f497c50f
line wrap: on
line diff
--- a/src/core/ngx_regex.h
+++ b/src/core/ngx_regex.h
@@ -18,7 +18,11 @@
 
 #define NGX_REGEX_CASELESS    PCRE_CASELESS
 
-typedef pcre  ngx_regex_t;
+
+typedef struct {
+    pcre        *pcre;
+    pcre_extra  *extra;
+} ngx_regex_t;
 
 
 typedef struct {
@@ -45,7 +49,7 @@ void ngx_regex_init(void);
 ngx_int_t ngx_regex_compile(ngx_regex_compile_t *rc);
 
 #define ngx_regex_exec(re, s, captures, size)                                \
-    pcre_exec(re, NULL, (const char *) (s)->data, (s)->len, 0, 0,            \
+    pcre_exec(re->pcre, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \
               captures, size)
 #define ngx_regex_exec_n      "pcre_exec()"