# HG changeset patch # User stefank # Date 1379103666 -7200 # Node ID 310317f40ee63bc033c01ad5cade1a758077bf07 # Parent 0fc247fb59bc9fe6ef92602af356eb9bd74e7829 8024651: Remove the incorrect usage of Metablock::overhead() Reviewed-by: brutisso, mgerdin, coleenp, jmasa diff -r 0fc247fb59bc -r 310317f40ee6 hotspot/src/share/vm/memory/metablock.cpp --- a/hotspot/src/share/vm/memory/metablock.cpp Thu Sep 12 10:15:54 2013 +0200 +++ b/hotspot/src/share/vm/memory/metablock.cpp Fri Sep 13 22:21:06 2013 +0200 @@ -50,13 +50,6 @@ // Chunks, change Chunks so that they can be allocated out of a VirtualSpace. size_t Metablock::_min_block_byte_size = sizeof(Metablock); -#ifdef ASSERT -size_t Metablock::_overhead = - Chunk::aligned_overhead_size(sizeof(Metablock)) / BytesPerWord; -#else -size_t Metablock::_overhead = 0; -#endif - // New blocks returned by the Metaspace are zero initialized. // We should fix the constructors to not assume this instead. Metablock* Metablock::initialize(MetaWord* p, size_t word_size) { diff -r 0fc247fb59bc -r 310317f40ee6 hotspot/src/share/vm/memory/metablock.hpp --- a/hotspot/src/share/vm/memory/metablock.hpp Thu Sep 12 10:15:54 2013 +0200 +++ b/hotspot/src/share/vm/memory/metablock.hpp Fri Sep 13 22:21:06 2013 +0200 @@ -48,7 +48,6 @@ } _header; } _block; static size_t _min_block_byte_size; - static size_t _overhead; typedef union block_t Block; typedef struct header_t Header; @@ -73,7 +72,6 @@ void set_prev(Metablock* v) { _block._header._prev = v; } static size_t min_block_byte_size() { return _min_block_byte_size; } - static size_t overhead() { return _overhead; } bool is_free() { return header()->_word_size != 0; } void clear_next() { set_next(NULL); } diff -r 0fc247fb59bc -r 310317f40ee6 hotspot/src/share/vm/memory/metaspace.cpp --- a/hotspot/src/share/vm/memory/metaspace.cpp Thu Sep 12 10:15:54 2013 +0200 +++ b/hotspot/src/share/vm/memory/metaspace.cpp Fri Sep 13 22:21:06 2013 +0200 @@ -737,9 +737,7 @@ // MinChunkSize is a placeholder for the real minimum size JJJ size_t byte_size = word_size * BytesPerWord; - size_t byte_size_with_overhead = byte_size + Metablock::overhead(); - - size_t raw_bytes_size = MAX2(byte_size_with_overhead, + size_t raw_bytes_size = MAX2(byte_size, Metablock::min_block_byte_size()); raw_bytes_size = ARENA_ALIGN(raw_bytes_size); size_t raw_word_size = raw_bytes_size / BytesPerWord;