aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mbitmap.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/mbitmap.go')
-rw-r--r--src/runtime/mbitmap.go4
1 files changed, 4 insertions, 0 deletions
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)