From 6b897966bf0c44d41055ce6ac093daad5611eb2f Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 15 Sep 2015 12:32:31 +0000 Subject: [PATCH] runtime: Ignore stack sizes when deciding when to GC. This restores https://golang.org/cl/6081043 which was lost accidentally when updating a new version of libgo in https://golang.org/cl/22440043 . Reviewed-on: https://go-review.googlesource.com/14569 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227784 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- libgo/runtime/mgc0.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 470981c..afb257e 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -ae60deadd72b3b29df98cee61deed68f251f0122 +23392287e9a26956977987fe95f337c5be4d6417 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/runtime/mgc0.c b/libgo/runtime/mgc0.c index 662dd87..9d8c025 100644 --- a/libgo/runtime/mgc0.c +++ b/libgo/runtime/mgc0.c @@ -2280,7 +2280,7 @@ gc(struct gc_args *args) heap0 = mstats.next_gc*100/(gcpercent+100); // conservatively set next_gc to high value assuming that everything is live // concurrent/lazy sweep will reduce this number while discovering new garbage - mstats.next_gc = mstats.heap_alloc+mstats.heap_alloc*gcpercent/100; + mstats.next_gc = mstats.heap_alloc+(mstats.heap_alloc-runtime_stacks_sys)*gcpercent/100; t4 = runtime_nanotime(); mstats.last_gc = runtime_unixnanotime(); // must be Unix time to make sense to user -- 2.7.4