From b5773b55256900db170a340f347d57cd775f628e Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 19 Jun 2019 14:29:24 -0400 Subject: [PATCH] Make GC mode the default. --- examples/app/nswrap.yaml | 2 -- examples/bluetooth/nswrap.yaml | 1 - examples/gc/nswrap.yaml | 1 - main.go | 13 +++++-------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/examples/app/nswrap.yaml b/examples/app/nswrap.yaml index db31016..4049192 100644 --- a/examples/app/nswrap.yaml +++ b/examples/app/nswrap.yaml @@ -44,5 +44,3 @@ subclasses: frameworks: [ Foundation, AppKit ] pragma: [ clang diagnostic ignored "-Wformat-security" ] -#autorelease: true -gogc: true diff --git a/examples/bluetooth/nswrap.yaml b/examples/bluetooth/nswrap.yaml index 6f2df9b..17ec604 100644 --- a/examples/bluetooth/nswrap.yaml +++ b/examples/bluetooth/nswrap.yaml @@ -39,4 +39,3 @@ delegates: - peripheralDidUpdateValueForCharacteristic pragma: [ clang diagnostic ignored "-Wformat-security" ] -gogc: true diff --git a/examples/gc/nswrap.yaml b/examples/gc/nswrap.yaml index 6d0d12f..81803f5 100644 --- a/examples/gc/nswrap.yaml +++ b/examples/gc/nswrap.yaml @@ -16,4 +16,3 @@ functions: frameworks: - Foundation pragma: [ clang diagnostic ignored "-Wformat-security" ] -gogc: true diff --git a/main.go b/main.go index fe317f1..299b0ac 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,6 @@ type conf struct { //Arc flag for debugging only, builds will break Arc bool Autorelease bool - Gogc bool } var Config conf @@ -251,19 +250,17 @@ func Start() (err error) { if Config.Positions { ast.TrackPositions = true } - if Config.Gogc && Config.Autorelease { - fmt.Printf("Cannot use Autorelease and Gogc directives at the same time\n") - os.Exit(-1) - } + wrap.Gogc = true + if Config.Arc { wrap.Arc = true + wrap.Gogc = false } if Config.Autorelease { wrap.Autorelease = true + wrap.Gogc = false } - if Config.Gogc { - wrap.Gogc = true - } + //NOTE: converting in parallel is slower on my system //nodes := convertLinesToNodesParallel(lines) nodes := convertLinesToNodes(lines)