Inlining Code Test

Nick Voronin elfy.nv at gmail.com
Sat Dec 18 22:54:34 PST 2010


On Sat, 18 Dec 2010 02:17:46 +0100
Don <nospam at nospam.com> wrote:

> Nick Voronin wrote:
> > btw, is there no explicit alignment for variables in D at all?
> > align(8) double d; compiles if d is global, but it does nothing.
> 
> That's a regression. Large globals are always aligned to a 16-byte 
> boundary (see changelog for 2.007)

On second thought large globals in static segment (as log says) are probably only those with __gshared prefix. And they do look aligned.

> However this code:
> 
> import core.stdc.stdio: printf;
> 
> int a;
> double[4] d;
> 
> void main() {
>      printf("%u %u\n", (cast(size_t)&a) % 8, (cast(size_t)&d) % 8);
> }
> shows that it stopped doing that somewhere between 2.027 and 2.030.


-- 
Nick Voronin <elfy.nv at gmail.com>


More information about the Digitalmars-d mailing list