go/src/unique/handle.go

var zero

type Handle

// Value returns a shallow copy of the T value that produced the Handle.
// Value is safe for concurrent use by multiple goroutines.
func (h Handle[T]) Value() T {}

// Make returns a globally unique handle for a value of type T. Handles
// are equal if and only if the values used to produce them are equal.
// Make is safe for concurrent use by multiple goroutines.
func Make[T comparable](value T) Handle[T] {}

var uniqueMaps

var cleanupMu

var cleanupFuncsMu

var cleanupFuncs

var cleanupNotify

type uniqueMap

func addUniqueMap[T comparable](typ *abi.Type) *uniqueMap[T] {}

var setupMake

// startBackgroundCleanup sets up a background goroutine to occasionally call cleanupFuncs.
func registerCleanup() {}

//go:linkname runtime_registerUniqueMapCleanup
func runtime_registerUniqueMapCleanup(cleanup func())