From 6b0f668044b7a8dd5d2360426cbcf6bd6785374d Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 4 Oct 2016 16:03:00 -0400 Subject: runtime: consolidate h_spans and mheap_.spans Like h_allspans and mheap_.allspans, these were two ways of referring to the spans array from when the runtime was split between C and Go. Clean this up by making mheap_.spans a slice and eliminating h_spans. Change-Id: I3aa7038d53c3a4252050aa33e468c48dfed0b70e Reviewed-on: https://go-review.googlesource.com/30532 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/malloc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 43b7e7970d..e85535ea9f 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -360,7 +360,7 @@ func mallocinit() { // To overcome this we ask for PageSize more and round up the pointer. p1 := round(p, _PageSize) - mheap_.spans = (**mspan)(unsafe.Pointer(p1)) + spansStart := p1 mheap_.bitmap = p1 + spansSize + bitmapSize if sys.PtrSize == 4 { // Set arena_start such that we can accept memory @@ -379,7 +379,7 @@ func mallocinit() { } // Initialize the rest of the allocator. - mheap_.init(spansSize) + mheap_.init(spansStart, spansSize) _g_ := getg() _g_.m.mcache = allocmcache() } -- cgit v1.3-5-g45d5