H1 2015 Priorities and Bare-Metal Programming

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 2 20:49:27 PST 2015


"Johannes Pfau"  wrote in message news:maotpd$1ape$1 at digitalmars.com...

> but if you instead write
> @property ref Volatile!ubyte PORTA()
> {
>     return *(cast(Volatile!(ubyte)*)0x05)
> }
>
> PORTA |= now calls a function behind the scenes. The backend does not
> immediately know that &PORTA is always 0x05. Also the this pointer in
> opopAssign is no longer a compile time constant. And this is were the
> constant/runtime value code gen difference discussed above matters.

It may not immediately know, but with guaranteed inlining it becomes a 
non-issue.

> -O mostly fixes performance problems, but adding an additional property
> function is still much uglier than declaring an extern variable with an
> address in many ways. (compiler bugs, user-facing code, debug info, ...)

I agree that pragma(address) is nicer. 



More information about the Digitalmars-d mailing list