comparison src/share/vm/memory/metachunk.cpp @ 12903: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 78bbf4d43a14
comparison
equal deleted inserted replaced
12902:bdfbb1fb19ca 12903:ec2e26e26183
31 class VirtualSpaceNode; 31 class VirtualSpaceNode;
32 32
33 const size_t metadata_chunk_initialize = 0xf7f7f7f7; 33 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
34 34
35 size_t Metachunk::object_alignment() { 35 size_t Metachunk::object_alignment() {
36 return ARENA_AMALLOC_ALIGNMENT; 36 // Must align pointers and sizes to 8,
37 // so that 64 bit types get correctly aligned.
38 const size_t alignment = 8;
39
40 // Make sure that the Klass alignment also agree.
41 STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
42
43 return alignment;
37 } 44 }
38 45
39 size_t Metachunk::overhead() { 46 size_t Metachunk::overhead() {
40 return align_size_up(sizeof(Metachunk), object_alignment()) / BytesPerWord; 47 return align_size_up(sizeof(Metachunk), object_alignment()) / BytesPerWord;
41 } 48 }