Is there a quick way to find the reference count for a particular scalar? Preferably using internal modules.
The intention is to make a cache that can expire references that are no longer used, which would be indicated by the reference count being 1, not zero, since the cache itself is a reference. These would be purged whenever required.