changeset 5507:ec2e26e26183

8026392: Metachunks and Metablocks are using a too large alignment Reviewed-by: coleenp, jmasa
author stefank
date Tue, 15 Oct 2013 14:32:20 +0200
parents bdfbb1fb19ca
children 9e5fadad7fdf
files src/share/vm/memory/metachunk.cpp
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/metachunk.cpp	Tue Oct 15 14:28:51 2013 +0200
+++ b/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() {