From 822a24b602038a443fc2b4c30f472eb904c30e23 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 30 Mar 2015 17:45:22 -0400 Subject: [PATCH] runtime: remove checkgc code from hashmap Currently hashmap is riddled with code that attempts to force a GC on the next allocation if checkgc is set. This no longer works as originally intended with the concurrent collector, and is apparently no longer used anyway. Remove checkgc. Change-Id: Ia6c17c405fa8821dc2e6af28d506c1133ab1ca0c Reviewed-on: https://go-review.googlesource.com/8355 Reviewed-by: Keith Randall --- src/runtime/hashmap.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index aaaef48381..9ca33992bb 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -96,9 +96,6 @@ const ( // sentinel bucket ID for iterator checks noCheck = 1<<(8*ptrSize) - 1 - - // trigger a garbage collection at every alloc called from this code - checkgc = false ) // A header for a Go map. @@ -246,16 +243,10 @@ func makemap(t *maptype, hint int64, h *hmap, bucket unsafe.Pointer) *hmap { // If hint is large zeroing this memory could take a while. buckets := bucket if B != 0 { - if checkgc { - memstats.next_gc = memstats.heap_alloc - } buckets = newarray(t.bucket, uintptr(1)<