Pointers vs. References

Michael Neumann mneumann at ntecs.de
Wed Jun 13 00:09:24 PDT 2007


Hi,

What I find confusing in D is the difference between references and 
pointers. References server somehow the same purpose.
What are the impacts on using references instead of pointers? (e.g. 
Neuron instead of Neuron*). Is there some GC magic involved for 
references? I've ported a pulsed neuronal network simulator from C++ to 
see how it behaves performance wise in D, but there must be really 
something wrong in D (or in my implementation), as it's at least 4x 
slower (and when the datasets grow, it takes infinitively long time).

And I guess I also found a bug in gdc:

Synapse x = ...;
while (x != null)
{
}

This segfaults, while:

Synapse x = ...
while (!(x is null))
{
}

does not.

Best regards,

   Michael



More information about the Digitalmars-d mailing list