shared-arena icon indicating copy to clipboard operation
shared-arena copied to clipboard

Add strong count function to ArenaArc

Open lenianiva opened this issue 1 year ago • 0 comments

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.

lenianiva avatar Oct 12 '23 20:10 lenianiva