From a3a5185b15fc61ed02dc13962f6b4d9c2146ea99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 16 Mar 2023 11:15:55 +0800 Subject: [PATCH] platform: Fix bytes format --- cmd/sing-box/debug.go | 6 +++--- experimental/libbox/setup.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/sing-box/debug.go b/cmd/sing-box/debug.go index 4f12ac92..bffa721f 100644 --- a/cmd/sing-box/debug.go +++ b/cmd/sing-box/debug.go @@ -25,9 +25,9 @@ func init() { runtime.ReadMemStats(&memStats) var memObject badjson.JSONObject - memObject.Put("heap", humanize.Bytes(memStats.HeapInuse)) - memObject.Put("stack", humanize.Bytes(memStats.StackInuse)) - memObject.Put("idle", humanize.Bytes(memStats.HeapIdle-memStats.HeapReleased)) + memObject.Put("heap", humanize.IBytes(memStats.HeapInuse)) + memObject.Put("stack", humanize.IBytes(memStats.StackInuse)) + memObject.Put("idle", humanize.IBytes(memStats.HeapIdle-memStats.HeapReleased)) memObject.Put("goroutines", runtime.NumGoroutine()) memObject.Put("rss", rusageMaxRSS()) diff --git a/experimental/libbox/setup.go b/experimental/libbox/setup.go index 222f9363..08855fd0 100644 --- a/experimental/libbox/setup.go +++ b/experimental/libbox/setup.go @@ -17,5 +17,5 @@ func Version() string { } func FormatBytes(length int64) string { - return humanize.Bytes(uint64(length)) + return humanize.IBytes(uint64(length)) }