generation

package
v0.0.0-...-1fc7c6f Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSlice

func AppendSlice[T any](gen *Generation, metadata *SliceMetadata, elems ...T)

func MakeSliceFromPtr

func MakeSliceFromPtr[T any](ptr unsafe.Pointer, len, cap int) []T

Types

type Generation

type Generation struct {
	// contains filtered or unexported fields
}

func NewGeneration

func NewGeneration(arenaSignals chan<- struct{}) *Generation

func (*Generation) Mark

func (gen *Generation) Mark(gcID uint64, searchMetadata SearchFunc)

func (*Generation) MoveTo

func (gen *Generation) MoveTo(dst *Generation)

func (*Generation) SearchObject

func (gen *Generation) SearchObject(addr unsafe.Pointer) (metadata *ObjectMetadata, exist bool)

func (*Generation) SearchSliceData

func (gen *Generation) SearchSliceData(slicePtr unsafe.Pointer) (metadata *SliceMetadata, exist bool)

func (*Generation) Size

func (gen *Generation) Size() int

func (*Generation) Sweep

func (gen *Generation) Sweep() (int, int)

type ObjectMetadata

type ObjectMetadata struct {
	sync.RWMutex
	Address unsafe.Pointer
	// contains filtered or unexported fields
}

func AllocateObject

func AllocateObject[T any](gen *Generation) *ObjectMetadata

type SearchFunc

type SearchFunc func(addr unsafe.Pointer) (metadata *ObjectMetadata, exist bool)

type SliceMetadata

type SliceMetadata struct {
	ObjectMetadata
	Len int
	Cap int
}

func AllocateSlice

func AllocateSlice[T any](gen *Generation, len, cap int) *SliceMetadata

Jump to

Keyboard shortcuts

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