Struct's alignment

Temtaime temtaime at gmail.com
Sat Aug 10 13:36:22 PDT 2013


Hello, guys!

I have Matrix class(that contains an array of 16 floats) and SSE 
code to mult it.
It's neccessary to have an array alignment 16.

I'm figured out simple test-code:

align(16) struct S {
	align(16) int a;
}


void main() {
	align(16) S s;
	writeln(cast(void *)&s.a);
}

And it prints 18FCC8, but must ends with "0". What i'm doing 
wrong?

Thanks.


More information about the Digitalmars-d-learn mailing list