On alignment
Tom Tromey
tromey@redhat.com
Wed Apr 23 17:41:00 GMT 2003
>>>>> "Jamie" == Jamie Lokier <jamie@shareable.org> writes:
Jamie> For the same reason, "struct foo { double x; }" as a standalone
Jamie> variable should have alignment 8, not 4. Andrew's test shows
Jamie> it has an alignment of 4.
In libgcj we need to find the alignment of things so that the
interpreter can compatibly lay out structures it creates. In the past
we didn't worry much about this, since compiled code couldn't observe
interpreted classes, but it is becoming a problem now.
I'd like to find the most future-proof way to do this. In the above,
is __alignof__(foo::x) the best way? I'm only concerned with
alignment of fields.
Tom
More information about the Gcc
mailing list