From 552156ff40bb8cd464bf48b147d1b464f92ca51f Mon Sep 17 00:00:00 2001 From: Haolan Date: Fri, 14 Nov 2025 15:28:52 +0800 Subject: [PATCH] fix: adjust gc stats struct --- .../internal/lib/runtime/runtime_gc_baremetal.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/internal/lib/runtime/runtime_gc_baremetal.go b/runtime/internal/lib/runtime/runtime_gc_baremetal.go index 43ab5573..f384b6d0 100644 --- a/runtime/internal/lib/runtime/runtime_gc_baremetal.go +++ b/runtime/internal/lib/runtime/runtime_gc_baremetal.go @@ -10,16 +10,18 @@ import ( func ReadMemStats(m *runtime.MemStats) { stats := tinygogc.ReadGCStats() - m.StackInuse = stats.StackInuse - m.StackSys = stats.StackSys - m.HeapSys = stats.HeapSys - m.GCSys = stats.GCSys + m.Alloc = stats.Alloc m.TotalAlloc = stats.TotalAlloc + m.Sys = stats.Sys m.Mallocs = stats.Mallocs m.Frees = stats.Frees - m.Sys = stats.Sys m.HeapAlloc = stats.HeapAlloc - m.Alloc = stats.Alloc + m.HeapSys = stats.HeapSys + m.HeapIdle = stats.HeapIdle + m.HeapInuse = stats.HeapInuse + m.StackInuse = stats.StackInuse + m.StackSys = stats.StackSys + m.GCSys = stats.GCSys } func GC() {