diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-05 20:12:44 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-05 20:12:44 +0400 |
commit | 4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce (patch) | |
tree | 5b5db25cbc0924431af3da685b7a0195ee8723a3 /src/expressions.h | |
parent | a2d1da15991d59bdc8663bc841258e5affd211ca (diff) | |
download | rspamd-4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce.tar.gz rspamd-4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce.zip |
* Add per-task regexp results cache, that would optimize regexp engine performance
by avoiding multiply match of the same regexp
Diffstat (limited to 'src/expressions.h')
-rw-r--r-- | src/expressions.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/expressions.h b/src/expressions.h index 5c2a391eb..5e7e134e6 100644 --- a/src/expressions.h +++ b/src/expressions.h @@ -88,4 +88,20 @@ void re_cache_add (char *line, void *pointer); */ void * re_cache_check (const char *line); +/** + * Add regexp to regexp task cache + * @param task task object + * @param pointer regexp data + * @param result numeric result of this regexp + */ +void task_cache_add (struct worker_task *task, void *pointer, int32_t result); + +/** + * Check regexp in cache + * @param task task object + * @param pointer regexp data + * @return numeric result if value exists or -1 if not + */ +int32_t task_cache_check (struct worker_task *task, void *pointer); + #endif |