July 09, 2006
"kris" <foo@bar.com> wrote in message news:e8qhlp$2rtk$1@digitaldaemon.com...

> Does D align double on 32bit or 64bit? How about double[] ?

double.alignof is 8 on my 32-bit machine.  And if array alignment works like I believe it does, double[] should also be 64-bit aligned.


July 09, 2006
Jarrett Billingsley wrote:
> "kris" <foo@bar.com> wrote in message news:e8qhlp$2rtk$1@digitaldaemon.com...
> 
> 
>>Does D align double on 32bit or 64bit? How about double[] ?
> 
> 
> double.alignof is 8 on my 32-bit machine.  And if array alignment works like I believe it does, double[] should also be 64-bit aligned. 
> 
> 


That's good. In reality, does it actually perform double-alignment on 64-bit boundaries?
July 10, 2006
"kris" <foo@bar.com> wrote in message news:e8rul1$1tkj$1@digitaldaemon.com...

> That's good. In reality, does it actually perform double-alignment on 64-bit boundaries?

Hmm.  Well, simple tests seem to show that memory allocations end up on 128-bit boundaries (hex addresses always end in 0), regardless of the type being allocated.  And so do stack (local) variables; I tried putting all kinds of alignments of types in a function, and doubles always end up on 64-bit boundaries.


1 2
Next ›   Last »