aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_url_test.c
diff options
context:
space:
mode:
authorcebka@mailsupport.rambler.ru <cebka@mailsupport.rambler.ru>2008-09-23 11:47:56 +0400
committercebka@mailsupport.rambler.ru <cebka@mailsupport.rambler.ru>2008-09-23 11:47:56 +0400
commit193acf73e51b24ccca8048ebb6aaec2971594268 (patch)
treea094617b2bb6c5d867584830f2ac4c6fa5f7b8fa /test/rspamd_url_test.c
parent2b65ae425b9dca345bea158471b358d3c17b9704 (diff)
downloadrspamd-193acf73e51b24ccca8048ebb6aaec2971594268.tar.gz
rspamd-193acf73e51b24ccca8048ebb6aaec2971594268.zip
* Small updates to memory pool library
- fix cases when new chunk is allocated - add memory pool allocator statistics - let it work in multi-threaded environment - add strdup function for convinience * Use memory pool allocator more widely to avoid memory leaks in future and optimize performance * Task pool chunk size is now pre-defined constant (16 Kb currently)
Diffstat (limited to 'test/rspamd_url_test.c')
-rw-r--r--test/rspamd_url_test.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/rspamd_url_test.c b/test/rspamd_url_test.c
index 43545252d..02aaa4a35 100644
--- a/test/rspamd_url_test.c
+++ b/test/rspamd_url_test.c
@@ -83,6 +83,7 @@ rspamd_url_test_func ()
html->len = strlen (test_html);
bzero (&task, sizeof (task));
TAILQ_INIT (&task.urls);
+ task.task_pool = memory_pool_new (8192);
g_test_timer_start ();
g_test_message ("Testing text URL regexp parser");
@@ -97,8 +98,6 @@ rspamd_url_test_func ()
while (!TAILQ_EMPTY (&task.urls)) {
url = TAILQ_FIRST (&task.urls);
TAILQ_REMOVE (&task.urls, url, next);
- g_free (url->string);
- g_free (url);
}
g_assert (i == 39);
@@ -117,8 +116,6 @@ rspamd_url_test_func ()
while (!TAILQ_EMPTY (&task.urls)) {
url = TAILQ_FIRST (&task.urls);
TAILQ_REMOVE (&task.urls, url, next);
- g_free (url->string);
- g_free (url);
}
g_assert (i == 1);
msg_debug ("Time elapsed: %.2f", g_test_timer_elapsed ());