aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/runtime/heapdump.go2
-rw-r--r--src/runtime/mbitmap.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/heapdump.go b/src/runtime/heapdump.go
index c317b5f969..f7d7aac2a7 100644
--- a/src/runtime/heapdump.go
+++ b/src/runtime/heapdump.go
@@ -474,7 +474,7 @@ func dumpobjs() {
throw("freemark array doesn't have enough entries")
}
- for freeIndex := s.freeindex; freeIndex < s.nelems; freeIndex++ {
+ for freeIndex := uintptr(0); freeIndex < s.nelems; freeIndex++ {
if s.isFree(freeIndex) {
freemark[freeIndex] = true
}
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go
index 3363cd0682..7171d3adbd 100644
--- a/src/runtime/mbitmap.go
+++ b/src/runtime/mbitmap.go
@@ -264,7 +264,11 @@ func (s *mspan) nextFreeIndex() uintptr {
return result
}
+// isFree returns whether the index'th object in s is unallocated.
func (s *mspan) isFree(index uintptr) bool {
+ if index < s.freeindex {
+ return false
+ }
whichByte := index / 8
whichBit := index % 8
byteVal := *addb(s.allocBits, whichByte)