scan

package standard library
master (7bba745) Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanAVX512

func CanAVX512() bool

func ExpandAVX512

func ExpandAVX512(sizeClass int, packed *gc.ObjMask, unpacked *gc.PtrMask)

ExpandAVX512 expands each bit in packed into f consecutive bits in unpacked, where f is the word size of objects in sizeClass.

This is a testing entrypoint to the expanders used by scanSpanPacked*.

func ExpandReference

func ExpandReference(sizeClass int, packed *gc.ObjMask, unpacked *gc.PtrMask)

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 FilterNil

func FilterNil(bufp *uintptr, n int32) int32

FilterNil packs non-nil (non-zero) values in bufp together at the beginning of bufp, returning the length of the packed buffer. It treats bufp as an array of size n.

TODO(mknyszek): Add a faster SIMD-based implementation.

func HasFastScanSpanPacked

func HasFastScanSpanPacked() bool

func ScanSpanPacked

func ScanSpanPacked(mem unsafe.Pointer, bufp *uintptr, objMarks *gc.ObjMask, sizeClass uintptr, ptrMask *gc.PtrMask) (count int32)

func ScanSpanPackedAVX512

func ScanSpanPackedAVX512(mem unsafe.Pointer, bufp *uintptr, objMarks *gc.ObjMask, sizeClass uintptr, ptrMask *gc.PtrMask) (count int32)

func ScanSpanPackedGo

func ScanSpanPackedGo(mem unsafe.Pointer, bufp *uintptr, objMarks *gc.ObjMask, sizeClass uintptr, ptrMask *gc.PtrMask) (count int32)

ScanSpanPackedGo is an optimized pure Go implementation of ScanSpanPacked.

func ScanSpanPackedReference

func ScanSpanPackedReference(mem unsafe.Pointer, bufp *uintptr, objMarks *gc.ObjMask, sizeClass uintptr, ptrMask *gc.PtrMask) (count int32)

ScanSpanPackedReference is the reference implementation of ScanScanPacked. It prioritizes clarity over performance.

Concretely, ScanScanPacked functions read pointers from mem, assumed to be gc.PageSize-aligned and gc.PageSize in size, and writes them to bufp, which is large enough to guarantee that even if pointer-word of mem is a pointer, it will fit. Therefore bufp, is always at least gc.PageSize in size.

ScanSpanPacked is supposed to identify pointers by first filtering words by objMarks, where each bit of the mask represents gc.SizeClassToSize[sizeClass] bytes of memory, and then filtering again by the bits in ptrMask.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL