diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-10-26 07:14:48 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-10-26 07:14:48 +0300 |
commit | cc5343692b448c27485a24ea7f1b24d714bb82f6 (patch) | |
tree | d659a1795fad4da55e18c8fc6297233d5b71b57e /mem_pool.c | |
parent | c52d0879cc03345a6c41c724db6a3de59cca7d07 (diff) | |
download | rspamd-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 'mem_pool.c')
-rw-r--r-- | mem_pool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mem_pool.c b/mem_pool.c index f720138dc..f116fff73 100644 --- a/mem_pool.c +++ b/mem_pool.c @@ -344,6 +344,17 @@ memory_pool_stat (memory_pool_stat_t *st) st->chunks_freed = chunks_freed; } +#define FIXED_POOL_SIZE 4095 +size_t +memory_pool_get_size () +{ +#ifdef HAVE_GETPAGESIZE + return getpagesize () - 1; +#else + return FIXED_POOL_SIZE; +#endif +} + /* * vi:ts=4 */ |