s.inlineMarkBits().init(s.spanclass)
}
-// mergeInlineMarks merges the span's inline mark bits into dst.
+// moveInlineMarks merges the span's inline mark bits into dst and clears them.
//
// gcUsesSpanInlineMarkBits(s.elemsize) must be true.
-func (s *mspan) mergeInlineMarks(dst *gcBits) {
+func (s *mspan) moveInlineMarks(dst *gcBits) {
if doubleCheckGreenTea && !gcUsesSpanInlineMarkBits(s.elemsize) {
throw("expected span with inline mark bits")
}
if doubleCheckGreenTea && !s.spanclass.noscan() && imb.marks != imb.scans {
throw("marks don't match scans for span with pointer")
}
+
+ // Reset the inline mark bits.
+ imb.init(s.spanclass)
}
// inlineMarkBits returns the inline mark bits for the span.
func (s *mspan) initInlineMarkBits() {
}
-func (s *mspan) mergeInlineMarks(to *gcBits) {
+func (s *mspan) moveInlineMarks(to *gcBits) {
throw("unimplemented")
}
}
}
- // Copy over the inline mark bits if necessary.
+ // Copy over and clear the inline mark bits if necessary.
if gcUsesSpanInlineMarkBits(s.elemsize) {
- s.mergeInlineMarks(s.gcmarkBits)
+ s.moveInlineMarks(s.gcmarkBits)
}
// Check for zombie objects.
// Initialize alloc bits cache.
s.refillAllocCache(0)
- // Reset the object queue, if we have one.
- if gcUsesSpanInlineMarkBits(s.elemsize) {
- s.initInlineMarkBits()
- }
-
// The span must be in our exclusive ownership until we update sweepgen,
// check for potential races.
if state := s.state.get(); state != mSpanInUse || s.sweepgen != sweepgen-1 {