GC for pure functions -- implementation ideas

Robert Jacques sandford at jhu.edu
Mon Nov 7 20:28:28 PST 2011


On Fri, 15 Apr 2011 16:12:34 -0400, Don <nospam at nospam.com> wrote:
[snip]
> In reality, things are going to be a bit more complicated than this. But
> it seems to me that conceptually, something like this could still stay fairly simple and be very, very fast. With no changes required to the language, and not even any changes required to existing code.

I really like this general concept (It feels a lot like young/old
generational collecting, but without the overhead), both for non-leaky
pure functions and ctfe.

On a side note, core.memory.gc is not currently marked pure and/or
nothrow, so Appender / containers which use the low level GC commands for
performance can't be used in pure/nothrow code. I'm not sure how to fix
this, as it would essentially have to violate the type system in a major
way. It's one more thing to think about with regard to purity and the GC.


More information about the Digitalmars-d mailing list