shared-arena
shared-arena copied to clipboard
Add strong count function to ArenaArc
This may be useful for hashconsing and bookkeeping
Example use case: I want to have a pool of hashconsigned AST objects, and I would store them in a hashmap HashMap<Expr, ArenaArc<Expr>>
. Then if I want to garbage collect the consign, I can simply delete all (k, v)
pairs such that v.strong_count() == 1
.