OSDN Git Service

* resolve.cc (_Jv_PrepareClass): Round up class size to multiple
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Apr 2003 02:17:12 +0000 (02:17 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Apr 2003 02:17:12 +0000 (02:17 +0000)
of alignment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65617 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/resolve.cc

index d4403ef..8d9944d 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-14  Tom Tromey  <tromey@redhat.com>
+
+       * resolve.cc (_Jv_PrepareClass): Round up class size to multiple
+       of alignment.
+
 2003-04-10  Tom Tromey  <tromey@redhat.com>
 
        * verify.cc (pop64): Removed.
index ea50645..fbdc284 100644 (file)
@@ -513,7 +513,10 @@ _Jv_PrepareClass(jclass klass)
        }
     }
 
-  // set the instance size for the class
+  // Set the instance size for the class.  Note that first we round it
+  // to the alignment required for Object; this keeps us in sync with
+  // our current ABI.
+  instance_size = ROUND (instance_size, __alignof__ (java::lang::Object));
   clz->size_in_bytes = instance_size;
 
   // allocate static memory