and is only meant to be used as an indicator rather than a precise
measure.
-ulong pool_total_allocated(void)
+ullong pool_total_allocated(void)
Report the total number of bytes allocated in all pools, for reporting
in the "PoolAlloc_MB" field of the "show info" output. The total is
calculated on the fly by summing the number of allocated bytes in all
pools and is only meant to be used as an indicator rather than a
precise measure.
-ulong pool_total_used(void)
+ullong pool_total_used(void)
Report the total number of bytes used in all pools, for reporting in
the "PoolUsed_MB" field of the "show info" output. The total is
calculated on the fly by summing the number of used bytes in all pools
void dump_pools(void);
int pool_parse_debugging(const char *str, char **err);
int pool_total_failures(void);
-unsigned long pool_total_allocated(void);
-unsigned long pool_total_used(void);
+unsigned long long pool_total_allocated(void);
+unsigned long long pool_total_used(void);
void pool_flush(struct pool_head *pool);
void pool_gc(struct pool_head *pool_ctx);
struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags);
}
/* This function returns the total amount of memory allocated in pools (in bytes) */
-unsigned long pool_total_allocated()
+unsigned long long pool_total_allocated()
{
struct pool_head *entry;
- unsigned long allocated = 0;
+ unsigned long long allocated = 0;
list_for_each_entry(entry, &pools, list)
- allocated += entry->allocated * entry->size;
+ allocated += entry->allocated * (ullong)entry->size;
return allocated;
}
/* This function returns the total amount of memory used in pools (in bytes) */
-unsigned long pool_total_used()
+unsigned long long pool_total_used()
{
struct pool_head *entry;
- unsigned long used = 0;
+ unsigned long long used = 0;
list_for_each_entry(entry, &pools, list)
- used += entry->used * entry->size;
+ used += entry->used * (ullong)entry->size;
return used;
}
info[INF_MEMMAX_MB] = mkf_u32(FO_CONFIG|FN_LIMIT, global.rlimit_memmax);
info[INF_MEMMAX_BYTES] = mkf_u32(FO_CONFIG|FN_LIMIT, global.rlimit_memmax * 1048576L);
info[INF_POOL_ALLOC_MB] = mkf_u32(0, (unsigned)(pool_total_allocated() / 1048576L));
- info[INF_POOL_ALLOC_BYTES] = mkf_u32(0, pool_total_allocated());
+ info[INF_POOL_ALLOC_BYTES] = mkf_u64(0, pool_total_allocated());
info[INF_POOL_USED_MB] = mkf_u32(0, (unsigned)(pool_total_used() / 1048576L));
- info[INF_POOL_USED_BYTES] = mkf_u32(0, pool_total_used());
+ info[INF_POOL_USED_BYTES] = mkf_u64(0, pool_total_used());
info[INF_POOL_FAILED] = mkf_u32(FN_COUNTER, pool_total_failures());
info[INF_ULIMIT_N] = mkf_u32(FO_CONFIG|FN_LIMIT, global.rlimit_nofile);
info[INF_MAXSOCK] = mkf_u32(FO_CONFIG|FN_LIMIT, global.maxsock);