优化代码

除1024改成右移10位
This commit is contained in:
xia-chu
2024-11-29 23:07:02 +08:00
parent 67668c9f2c
commit 87b42ab492
13 changed files with 17 additions and 17 deletions

View File

@@ -570,7 +570,7 @@ void getStatisticJson(const function<void(Value &val)> &cb) {
#ifdef ENABLE_MEM_DEBUG
auto bytes = getTotalMemUsage();
val["totalMemUsage"] = (Json::UInt64) bytes;
val["totalMemUsageMB"] = (int) (bytes / 1024 / 1024);
val["totalMemUsageMB"] = (int) (bytes >> 20);
val["totalMemBlock"] = (Json::UInt64) getTotalMemBlock();
static auto block_type_size = getBlockTypeSize();
{
@@ -604,7 +604,7 @@ void getStatisticJson(const function<void(Value &val)> &cb) {
auto bytes = getThisThreadMemUsage();
val["threadName"] = getThreadName();
val["threadMemUsage"] = (Json::UInt64) bytes;
val["threadMemUsageMB"] = (Json::UInt64) (bytes / 1024 / 1024);
val["threadMemUsageMB"] = (Json::UInt64) (bytes >> 20);
val["threadMemBlock"] = (Json::UInt64) getThisThreadMemBlock();
{
int i = 0;