A map using a lock-free concurrency using left-right algo, written in Go
commits
Author
Commit
Message
Date
Instead of using an outer and an inner read handler that use
runtime.Finalizer to clear abandoned instances, use the new weak
pointers and runtime.AddCleanup.
With Go generics landing into the main branch it is not necessary anymore to
provide go2 template files. Instead regular go source code files are used.
I think I did that to work around a go2go compiler bug, but it was not
necessary.
When the user misses the ReadHandler's Close(), its finalizer is never called anyway, because there remains a reference in LRMap. Close()'s job is to remove that ref. Users who don't call Close() on resources that provide that method have to live with resource leaks as is tradition.