Object alignment, was: cygwin failures - assertion "!(addr & FLAGS)" failed:

Tom Tromey tromey@redhat.com
Sun May 5 17:14:00 GMT 2002

>>>>> "David" == Billinghurst, David (CRTS) <David.Billinghurst@riotinto.com> writes:

David> So we need objects to be 8-byte aligned so that the low three
David> bits of the address are 0?  Are there any ways around this, as
David> I don't think that this is the default on cygwin.

For libgcj this decision is made either by the GC (for dynamically
allocated objects) or the compiler (for statically allocated objects).

The GC should already be doing this.

The compiler might not, but that is something that, in theory, we can
fix entirely in gcj by setting the required alignment correctly.

David>  - it is necessary to rebuild ld to ensure 8-byte alignment

... there is some problem getting ld to do this even when gcj sets the
alignment correctly on the type.

It looks like the alignment is in fact set correctly in gcj:

  /* Hash synchronization requires at least 64-bit alignment. */
  if (flag_hash_synchronization && POINTER_SIZE < 64)
    DECL_ALIGN (decl) = 64; 


More information about the Java mailing list