add compile-time flag to disable Go GC (MR 56)
I hate this, but it's the only good way I could find to allow working around this ugly QEMU bug: https://gitlab.com/qemu-project/qemu/-/issues/2560
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/archive"
|
||||
@@ -26,8 +28,14 @@ import (
|
||||
|
||||
// set at build time
|
||||
var Version string
|
||||
var DisableGC string
|
||||
|
||||
func main() {
|
||||
// To allow working around silly GC-related issues, like https://gitlab.com/qemu-project/qemu/-/issues/2560
|
||||
if strings.ToLower(DisableGC) == "true" {
|
||||
debug.SetGCPercent(-1)
|
||||
}
|
||||
|
||||
retCode := 0
|
||||
defer func() { os.Exit(retCode) }()
|
||||
|
||||
|
Reference in New Issue
Block a user