]> Cypherpunks repositories - gostls13.git/commit
runtime: use len(h.spans) to indicate mapped region
authorAustin Clements <austin@google.com>
Tue, 4 Oct 2016 20:22:41 +0000 (16:22 -0400)
committerAustin Clements <austin@google.com>
Tue, 25 Oct 2016 22:32:51 +0000 (22:32 +0000)
commit5915ce66742415d96d5a082c41d31f965b719f26
tree6cf9cd7a133e1d78fb11bc2141046c6b7e412b45
parent6b0f668044b7a8dd5d2360426cbcf6bd6785374d
runtime: use len(h.spans) to indicate mapped region

Currently we set the len and cap of h.spans to the full reserved
region of the address space and track the actual mapped region
separately in h.spans_mapped. Since we have both the len and cap at
our disposal, change things so len(h.spans) tracks how much of the
spans array is mapped and eliminate h.spans_mapped. This simplifies
mheap and means we'll get nice "index out of bounds" exceptions if we
do try to go off the end of the spans rather than a SIGSEGV.

Change-Id: I8ed9a1a9a844d90e9fd2e269add4704623dbdfe6
Reviewed-on: https://go-review.googlesource.com/30533
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mheap.go