From b36be05c1e6e9bc092516b712706b806b83d40aa Mon Sep 17 00:00:00 2001 From: Haolan Date: Fri, 19 Sep 2025 11:37:10 +0800 Subject: [PATCH] fix: GC() signature --- runtime/internal/runtime/tinygogc/gc_tinygo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/internal/runtime/tinygogc/gc_tinygo.go b/runtime/internal/runtime/tinygogc/gc_tinygo.go index 5aa476ae..a2a71aa5 100644 --- a/runtime/internal/runtime/tinygogc/gc_tinygo.go +++ b/runtime/internal/runtime/tinygogc/gc_tinygo.go @@ -352,10 +352,11 @@ func free(ptr unsafe.Pointer) { // TODO: free blocks on request, when the compiler knows they're unused. } -func GC() { +func GC() uintptr { lock(&gcMutex) - gc() + freeBytes := gc() unlock(&gcMutex) + return freeBytes } // runGC performs a garbage collection cycle. It is the internal implementation