From 46da99bbba37298fd29640872256da264b6b3eec Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Mon, 30 Mar 2020 18:44:34 +0800 Subject: [PATCH] mblock stat type: int to int64_t --- src/fast_mblock.c | 5 +++-- src/fast_mblock.h | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/fast_mblock.c b/src/fast_mblock.c index cceb2db..b55c5be 100644 --- a/src/fast_mblock.c +++ b/src/fast_mblock.c @@ -262,7 +262,7 @@ int fast_mblock_manager_stat_print_ex(const bool hide_empty, const int order_by) { if (pStat->trunk_total_count > 0) { - amem = pStat->trunk_size * pStat->trunk_total_count; + amem = (int64_t)pStat->trunk_size * pStat->trunk_total_count; alloc_mem += amem; used_mem += GET_BLOCK_SIZE(*pStat) * pStat->element_used_count; @@ -278,7 +278,8 @@ int fast_mblock_manager_stat_print_ex(const bool hide_empty, const int order_by) } } - logInfo("%20s %8d %8d %12"PRId64" %10d %10d %10d %10d %10d %11.2f%%", + logInfo("%20s %8d %8d %12"PRId64" %10"PRId64" %10"PRId64 + " %10"PRId64" %10"PRId64" %10"PRId64" %11.2f%%", pStat->name, pStat->element_size, pStat->instance_count, amem, pStat->trunk_total_count, pStat->trunk_used_count, pStat->element_total_count, pStat->element_used_count, diff --git a/src/fast_mblock.h b/src/fast_mblock.h index 5bc10d7..27d8ddb 100644 --- a/src/fast_mblock.h +++ b/src/fast_mblock.h @@ -57,13 +57,13 @@ struct fast_mblock_info { char name[FAST_MBLOCK_NAME_SIZE]; int element_size; //element size - int element_total_count; //total element count - int element_used_count; //used element count - int delay_free_elements; //delay free element count int trunk_size; //trunk size - int trunk_total_count; //total trunk count - int trunk_used_count; //used trunk count int instance_count; //instance count + int64_t element_total_count; //total element count + int64_t element_used_count; //used element count + int64_t delay_free_elements; //delay free element count + int64_t trunk_total_count; //total trunk count + int64_t trunk_used_count; //used trunk count }; struct fast_mblock_trunks