package intern
Import Path
internal/intern (on go.dev)
Dependency Relation
imports 4 packages, and imported by one package
Involved Source Files
Package intern lets you make smaller comparable values by boxing
a larger comparable value (such as a 16 byte string header) down
into a globally unique 8 byte pointer.
The globally unique pointers are garbage collected with weak
references and finalizers. This package hides that.
Package-Level Type Names (total 2, in which 1 is exported)
A Value pointer is the handle to an underlying comparable value.
See func Get for how Value pointers may be used.
cmpVal any
resurrected is guarded by mu (for all instances of Value).
It is set true whenever v is synthesized from a uintptr.
Get returns the comparable value passed to the Get func
that returned v.
func Get(cmpVal any) *Value
func GetByString(s string) *Value
func get(k key) *Value
func safeMap() map[key]*Value
func finalize(v *Value)
var net/netip.z0 *Value
var net/netip.z4 *Value
var net/netip.z6noz *Value
Package-Level Functions (total 6, in which 2 are exported)
Get returns a pointer representing the comparable value cmpVal.
The returned pointer will be the same for Get(v) and Get(v2)
if and only if v == v2, and can be used as a map key.
GetByString is identical to Get, except that it is specialized for strings.
This avoids an allocation from putting a string into an interface{}
to pass as an argument to Get.
Package-Level Variables (total 4, none are exported)
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |