8026392: Metachunks and Metablocks are using a too large alignment
Reviewed-by: coleenp, jmasa
--- 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() {