From: Shenghou Ma Date: Wed, 13 Aug 2014 02:28:25 +0000 (-0400) Subject: [dev.power64] runtime: disable GC and use a larger default stack X-Git-Tag: go1.5beta1~2684^2~25^2~55 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9b88857f7565a426d1469e8a9b51d9bf045adc9b;p=gostls13.git [dev.power64] runtime: disable GC and use a larger default stack LGTM=rsc R=rsc, iant CC=golang-codereviews https://golang.org/cl/128120043 --- diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go index dedcea94a6..68baa80d52 100644 --- a/src/pkg/runtime/malloc.go +++ b/src/pkg/runtime/malloc.go @@ -278,7 +278,7 @@ func profilealloc(mp *m, x unsafe.Pointer, size uintptr) { // force = 1 - do GC regardless of current heap usage // force = 2 - go GC and eager sweep func gogc(force int32) { - if memstats.enablegc == 0 { + if GOARCH == "power64" || GOARCH == "power64le" || memstats.enablegc == 0 { return } diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index e7955151ce..03622db283 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1305,6 +1305,10 @@ runtime·gc(int32 force) if(!mstats.enablegc || g == g->m->g0 || g->m->locks > 0 || runtime·panicking) return; + if(thechar == '9') { + runtime·gcpercent = -1; + return; + } if(runtime·gcpercent == GcpercentUnknown) { // first time through runtime·lock(&runtime·mheap); if(runtime·gcpercent == GcpercentUnknown) diff --git a/src/pkg/runtime/stack.h b/src/pkg/runtime/stack.h index ee5fd351d5..64d377754f 100644 --- a/src/pkg/runtime/stack.h +++ b/src/pkg/runtime/stack.h @@ -76,7 +76,7 @@ enum { // The minimum stack segment size to allocate. // If the amount needed for the splitting frame + StackExtra // is less than this number, the stack will have this size instead. - StackMin = 8192, + StackMin = 65536, StackSystemRounded = StackSystem + (-StackSystem & (StackMin-1)), FixedStack = StackMin + StackSystemRounded,