Andrei Alexandrescu wrote:
Christopher Wright wrote:
This means replacing a mark/sweep GC with a reference counting GC.
It just means that certain types and constructs are rewritten. The exact
strategy depends on how Ref, Array, and AssocArray are defined.
Probably a good approach is to simply rewrite anything anyway and have
Ref vanish in gc mode by means of e.g. alias this.
So this means that we only need a flag -object=/path/to/object.d after all.
Well, sure, if you're going for the *entirely* general solution :)
I like it, by the way. It would also make it easier to deal with the
builtin aggregate types via reflection, if Array and AssocArray were in
object.d.
Anyway, if D supported implicit refcounting as well as mark/sweep,
that's a lot closer to supporting any random allocation scheme I might
dream up.
Also, it might be good to separate object.d into several modules in that
case. That might not be so fun from the compiler's view or an efficiency
standpoint, though.