summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2008-10-26 07:14:48 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2008-10-26 07:14:48 +0300
commitcc5343692b448c27485a24ea7f1b24d714bb82f6 (patch)
treed659a1795fad4da55e18c8fc6297233d5b71b57e /main.c
parentc52d0879cc03345a6c41c724db6a3de59cca7d07 (diff)
downloadrspamd-cc5343692b448c27485a24ea7f1b24d714bb82f6.tar.gz
rspamd-cc5343692b448c27485a24ea7f1b24d714bb82f6.zip
* Add determining page size function to mem_pool library
* Add simple statistic structure that is placed in shared memory and used for gathering server's stats
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index 81effd61d..d2dec7e47 100644
--- a/main.c
+++ b/main.c
@@ -172,6 +172,7 @@ main (int argc, char **argv)
rspamd = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main));
bzero (rspamd, sizeof (struct rspamd_main));
+ rspamd->server_pool = memory_pool_new (memory_pool_get_size ());
cfg = (struct config_file *)g_malloc (sizeof (struct config_file));
rspamd->cfg = cfg;
if (!rspamd || !rspamd->cfg) {
@@ -186,8 +187,11 @@ main (int argc, char **argv)
do_reopen_log = 0;
active_worker = NULL;
+ rspamd->stat = memory_pool_alloc_shared (rspamd->server_pool, sizeof (struct rspamd_stat));
+ bzero (rspamd->stat, sizeof (struct rspamd_stat));
+
bzero (rspamd->cfg, sizeof (struct config_file));
- rspamd->cfg->cfg_pool = memory_pool_new (32768);
+ rspamd->cfg->cfg_pool = memory_pool_new (memory_pool_get_size ());
init_defaults (rspamd->cfg);
bzero (&signals, sizeof (struct sigaction));