What's left for 1.0?
Benji Smith
dlanguage at benjismith.net
Thu Nov 16 11:31:36 PST 2006
Bill Baxter wrote:
> So, what's left on everyone's lists for D1.0 must-have features?
Although D doesn't currently use a generational copying collector, it
would be nice if we could anticipate the hurdles to implementing a
copying GC in the current language, and develop some syntactic
extensions to the language for copying with a copying GC.
In a language like Java, where there are only reference types and
primitives (i.e., no pointers), the implementation of a copying GC is
pretty straightforward, because when an object gets moved to a new
location in memory, you never have to worry that it will leave behind a
orphaned pointer.
In C#, which does allow pointers, certain blocks of code are marked as
unsafe, and certain objects or pointers can be temporarily "pinned" to
their current memory location. If the GC thread comes to life during the
execution of an unsafe block, the GC will ignore any objects or pointers
that have been pinned at their current location. Those items will be
collected later, during a subsequent GC run, after they've been "un-pinned".
It would be nice, before version 1.0 of D, to get the syntax in place
for pinning pointers. With the current GC, all objects are permanently
"pinned" anyhow, so this implementation would be semantically correct,
even if it didn't do anything :) But at least, with the syntax in place,
we'd be prepared for the eventual introduction of a generational copying
GC, when such a thing is inevitably implemented.
--benji
More information about the Digitalmars-d
mailing list