Re: alignment on powerpc
"Chris Pickett" <[email protected]> Wed, 3 May 2006 08:58:08 -0400 (EDT)
| Newsgroups | gmane.comp.java.vm.sablevm.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, May 3, 2006 6:56 am, Etienne Gagnon wrote:
> The program you copied is not the same as the one in system.h. Can you
> run the program in system.h, first?
Yes, I've done that now, and I still get alignment =3D 4.
Btw, for anyone else who cares, a nice explanation of Etienne's technique
is here:
http://www.monkeyspeak.com/alignment/
although it's been generalized beyond words.
Cheers,
Chris
>
> Etienne
>
>
> Chris Pickett wrote:
>
>> If I run the (slightly modified) program following this message from
>> libsablevm/system.h on a 32-bit iBook under Mac OS X with gcc 3.3, I g=
et
>> "alignment =3D 4" printed out. Yet we have
>> ...
>> #include <stdio.h>
>>
>>
>> struct { char c; int v; } a;
>>
>>
>> int main (int argc, char *argv[]) {
>> printf ("alignment =3D %u\n", (unsigned int) (((char *) &a.v) - ((char=
*)
>> &a)));
>> return 0; }
>>
>
> --
> Etienne M. Gagnon, Ph.D. http://www.info2.uqam.ca/~egagnon/
> SableVM: http://www.sablevm.org/
> SableCC: http://www.sablecc.org/
>
>