Past year I've implemented SModel, which is a crate implementing a procedural macro for generating hierarchical structures for use in the semantic model of language compilers.
What worries me is that in my actual project I sometimes create throwaway entities using the arena there (which is simply a vector of Rc
s without auto cleanup; allocations result in Weak
references). I'm not sure if this is a problem regarding memory, but the arena may indeed accumulate objects and it will never dispose them until the program stops executing.
The reason I couldn't use Gc
was that semantic entities sometimes reference back source locations which themsevles don't implement Trace
and Finalize
.
I think I also use ByAddress
with the objects created in the arena