8026392: Metachunks and Metablocks are using a too large alignment
authorstefank
Tue, 15 Oct 2013 14:32:20 +0200
changeset 20730 59f433c86d9d
parent 20729 0a687ee7097d
child 20731 079142abff59
8026392: Metachunks and Metablocks are using a too large alignment Reviewed-by: coleenp, jmasa
hotspot/src/share/vm/memory/metachunk.cpp
--- a/hotspot/src/share/vm/memory/metachunk.cpp	Tue Oct 15 14:28:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/metachunk.cpp	Tue Oct 15 14:32:20 2013 +0200
@@ -33,7 +33,14 @@
 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
 
 size_t Metachunk::object_alignment() {
-  return ARENA_AMALLOC_ALIGNMENT;
+  // Must align pointers and sizes to 8,
+  // so that 64 bit types get correctly aligned.
+  const size_t alignment = 8;
+
+  // Make sure that the Klass alignment also agree.
+  STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
+
+  return alignment;
 }
 
 size_t Metachunk::overhead() {