]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads/regex: Change Regex trash buffer into a thread local variable
authorEmeric Brun <ebrun@haproxy.com>
Thu, 15 Jun 2017 09:53:49 +0000 (11:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:31 +0000 (13:58 +0100)
include/common/regex.h
src/regex.c

index 2f171b3ba369c5e66bf7bf361bfb9eb8061bd7c6..c3b921b3f178aa95ab6376df25d9b35ab6bb616b 100644 (file)
@@ -76,7 +76,7 @@ struct hdr_exp {
     void *cond;                                /* a possible condition or NULL */
 };
 
-extern regmatch_t pmatch[MAX_MATCH];
+extern THREAD_LOCAL regmatch_t pmatch[MAX_MATCH];
 
 /* "str" is the string that contain the regex to compile.
  * "regex" is preallocated memory. After the execution of this function, this
index 38d7132b3de048402ba8d81df04a05cc302ec894..993a37a431e2ac75a88119723b902958f22dbeca 100644 (file)
@@ -22,7 +22,7 @@
 #include <proto/log.h>
 
 /* regex trash buffer used by various regex tests */
-regmatch_t pmatch[MAX_MATCH];  /* rm_so, rm_eo for regular expressions */
+THREAD_LOCAL regmatch_t pmatch[MAX_MATCH];  /* rm_so, rm_eo for regular expressions */
 
 int exp_replace(char *dst, unsigned int dst_size, char *src, const char *str, const regmatch_t *matches)
 {