MINOR: threads/regex: Change Regex trash buffer into a thread local variable

This commit is contained in:
Emeric Brun 2017-06-15 11:53:49 +02:00 committed by Willy Tarreau
parent 8c1aaa201a
commit 272e252e61
2 changed files with 2 additions and 2 deletions

View 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

View 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)
{