// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package scan

import (
	
	
)

// ExpandReference is a reference implementation of an expander function
// that translates object mark bits into a bitmap of one bit per word of
// marked object, assuming the object is of the provided size class.
func ( int,  *gc.ObjMask,  *gc.PtrMask) {
	// Look up the size and derive the number of objects in a span.
	// We're only concerned with small objects in single-page spans,
	// and gc.PtrMask enforces this by being statically sized to
	// accommodate only such spans.
	 := uintptr(gc.SizeClassToSize[])
	 := uintptr(gc.SizeClassToNPages[]) * gc.PageSize / 

	// f is the expansion factor. For example, if our objects are of size 48,
	// then each mark bit will translate into 6 (48/8 = 6) set bits in the
	// pointer bitmap.
	 :=  / goarch.PtrSize
	for  := range  {
		// Check if the object is marked.
		if [/goarch.PtrBits]&(uintptr(1)<<(%goarch.PtrBits)) == 0 {
			continue
		}
		// Propagate that mark into the destination into one bit per the
		// expansion factor f, offset to the object's offset within the span.
		for  := range  {
			 := * +  // i*f is the start bit for the object, j indexes into each corresponding word after.
			[/goarch.PtrBits] |= uintptr(1) << ( % goarch.PtrBits)
		}
	}
}