Documentation ¶
Overview ¶
Package gc defines a generic garbage collector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct { // World specifies a World that should be stopped before a // collection and started again after. World World Marker Marker Roots Enumerator Sweeper Enumerator ItemEnumerator ItemEnumerator Deleter Deleter }
A Collector performs a garbage collection.
type Deleter ¶
type Enumerator ¶
type Enumerator interface { // Enumerate enumerates items (which items depends on usage) // and sends them to the provided channel. Regardless of return // value, the channel should be closed. // // If the provided context is closed, Enumerate should return // with an error (typically context.Canceled) Enumerate(context.Context, chan<- Item) error }
Enumerator enumerates items.
type Item ¶
type Item interface{}
Item is something that exists that may or may not survive a GC collection.
type ItemEnumerator ¶
type ItemEnumerator interface { // EnumerateItme is like Enuerator's Enumerate, but specific // to the provided item. EnumerateItem(context.Context, Item, chan<- Item) error }
ItemEnumerator enumerates all the edges out from an item.
type Marker ¶
Click to show internal directories.
Click to hide internal directories.