fix: add gc dummy mutex
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
package runtime
|
||||
|
||||
import "runtime"
|
||||
|
||||
// Layout of in-memory per-function information prepared by linker
|
||||
// See https://golang.org/s/go12symtab.
|
||||
// Keep in sync with linker (../cmd/link/internal/ld/pcln.go:/pclntab)
|
||||
@@ -30,10 +28,6 @@ func StopTrace() {
|
||||
panic("todo: runtime.StopTrace")
|
||||
}
|
||||
|
||||
func ReadMemStats(m *runtime.MemStats) {
|
||||
panic("todo: runtime.ReadMemStats")
|
||||
}
|
||||
|
||||
func SetMutexProfileFraction(rate int) int {
|
||||
panic("todo: runtime.SetMutexProfileFraction")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
|
||||
package runtime
|
||||
|
||||
import "github.com/goplus/llgo/runtime/internal/clite/bdwgc"
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/goplus/llgo/runtime/internal/clite/bdwgc"
|
||||
)
|
||||
|
||||
func ReadMemStats(m *runtime.MemStats) {
|
||||
panic("todo: runtime.ReadMemStats")
|
||||
}
|
||||
|
||||
func GC() {
|
||||
bdwgc.Gcollect()
|
||||
|
||||
@@ -2,7 +2,25 @@
|
||||
|
||||
package runtime
|
||||
|
||||
import "github.com/goplus/llgo/runtime/internal/runtime/tinygogc"
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/goplus/llgo/runtime/internal/runtime/tinygogc"
|
||||
)
|
||||
|
||||
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.TotalAlloc = stats.TotalAlloc
|
||||
m.Mallocs = stats.Mallocs
|
||||
m.Frees = stats.Frees
|
||||
m.Sys = stats.Sys
|
||||
m.HeapAlloc = stats.HeapAlloc
|
||||
m.Alloc = stats.Alloc
|
||||
}
|
||||
|
||||
func GC() {
|
||||
tinygogc.GC()
|
||||
|
||||
Reference in New Issue
Block a user