aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-10-04 16:03:00 -0400
committerAustin Clements <austin@google.com>2016-10-25 22:32:48 +0000
commit6b0f668044b7a8dd5d2360426cbcf6bd6785374d (patch)
treec4995a5bb177ab5de960c5e913bfe82379f7a441 /src/runtime/malloc.go
parent66e849b168eef36a4159a4b038fe89eecd2f22e3 (diff)
downloadgo-6b0f668044b7a8dd5d2360426cbcf6bd6785374d.tar.xz
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 <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go4
1 files changed, 2 insertions, 2 deletions
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()
}