proxy.golang.org : github.com/jba/weakmap
Package weakmap implements a map with weak keys. One use for such a map is storing auxiliary data with values that are not under your control. For example, if you wanted to associated additional information with values of some type *p.T, where package p is not under your control, you could use a weakmap whose keys are *p.T values and whose values are your additional information. // The advantage over using an ordinary map is that when a *p.T gets garbage-collected, your associated data is removed from the map. This should be considered a proof of concept, for educational purposes only. The problem is that the implementation requires setting a finalizer on the keys, which removes any existing finalizer. There is no way for the program to tell if there is an existing finalizer, so it cannot detect this problem.
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/jba/weakmap
License: MIT
Latest release: 19 days ago
Namespace: github.com/jba
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 19 days ago