summaryrefslogtreecommitdiffstats
path: root/src/mem_pool.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-08 18:46:39 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-08 18:46:39 +0400
commitfe2efaafebe67860ec3f5b3c259208ce7db05eeb (patch)
tree7f02bbed389e4bd6e19a45e91c712887945155c5 /src/mem_pool.c
parentafe65479c0052b38e080d7d9adaeba7326823dea (diff)
downloadrspamd-fe2efaafebe67860ec3f5b3c259208ce7db05eeb.tar.gz
rspamd-fe2efaafebe67860ec3f5b3c259208ce7db05eeb.zip
* Improve performance of IO reading by reworking IO dispatcher algorithm
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r--src/mem_pool.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c
index df4c544f9..76ae1141b 100644
--- a/src/mem_pool.c
+++ b/src/mem_pool.c
@@ -24,6 +24,7 @@
#include "config.h"
#include "mem_pool.h"
+#include "fstring.h"
/* Sleep time for spin lock in nanoseconds */
#define MUTEX_SLEEP_TIME 10000000L
@@ -228,6 +229,22 @@ memory_pool_strdup (memory_pool_t *pool, const char *src)
}
char *
+memory_pool_fstrdup (memory_pool_t *pool, const struct f_str_s *src)
+{
+ char *newstr;
+
+ if (src == NULL) {
+ return NULL;
+ }
+
+ newstr = memory_pool_alloc (pool, src->len + 1);
+ memcpy (newstr, src->begin, src->len);
+ newstr[src->len] = '\0';
+ return newstr;
+}
+
+
+char *
memory_pool_strdup_shared (memory_pool_t *pool, const char *src)
{
memory_pool_ssize_t len;