On Tuesday, 24 February 2015 at 07:53:52 UTC, Jacob Carlborg
wrote:
On 2015-02-23 21:30, Walter Bright wrote:
Count me among those.
In Java, write barriers make sense because Java uses the GC for
everything. Pretty much every indirection is a GC reference.
This is not at all true with D code. But since the compiler
can't know
that, it has to insert write barriers for all those
dereferences
regardless.
The alternative would be to have two kind of pointers, one for
GC allocated data and one for other kind of data. But I know
you don't like that either.
We kind of already have this, class references and regular
pointers. But that would tie classes to the GC.
I suspect it would be a terrible performance hit.
It would be nice to have some numbers backing this up.
This the approach taken by Active Oberon and Modula-3.
Pointers are GC by default, but can be declared as untraced
pointers in code considered @system like in D.
--
Paulo