DIP20: Volatile read/write intrinsics

David Nadlinger see at klickverbot.at
Wed Oct 10 12:10:17 PDT 2012


On Wednesday, 10 October 2012 at 19:21:24 UTC, Adam D. Ruppe 
wrote:
> This does bring me to a question though. What if you had:
>
> void foo() {
>    volatile_read();
> }
>
> foo();
> bar();
> foo();
>
> Is the call to foo allowed to be reordered? I imagine it has to 
> mark the whole call chain upwards as internally volatile too.

Function calls are never allowed to be reordered. In D, there 
might be some exceptions regarding strong purity, but the 
volatile instructions just couldn't/wouldn't be pure.

David


More information about the Digitalmars-d mailing list