DIP25 draft available for destruction
Steven Schveighoffer
schveiguy at yahoo.com
Wed Feb 6 10:46:40 PST 2013
On Wed, 06 Feb 2013 02:38:17 -0500, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Probably it'll need a fair amount of tweaking. Anyhow it's in
> destroyable form.
>
> http://wiki.dlang.org/DIP25
First reaction:
It should be GUARANTEED that addressOf is a simple load of the underlying
pointer that ref represents. That is, the library/compiler should be
compelled not to call a specific function or otherwise execute anything
but a simple load (if not already in a register). If that can't be
implemented, this whole DIP falls apart.
The reason being, that although we want to make it clear the intentions of
the code (by using the knowingly unsafe addressOf and not &), we don't
want to penalize code for doing so. The D compiler and library should be
neutral on performance, even if it is overly nanny-ish when it comes to
safety.
-Steve
More information about the Digitalmars-d
mailing list