From 79e83732c847e474a0df0fcfa7f868b66d8e1f56 Mon Sep 17 00:00:00 2001 From: stefank Date: Fri, 13 Sep 2013 22:21:06 +0200 Subject: [PATCH] 8024651: Remove the incorrect usage of Metablock::overhead() Reviewed-by: brutisso, mgerdin, coleenp, jmasa --- src/share/vm/memory/metablock.cpp | 7 ------- src/share/vm/memory/metablock.hpp | 2 -- src/share/vm/memory/metaspace.cpp | 4 +--- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/share/vm/memory/metablock.cpp b/src/share/vm/memory/metablock.cpp index 450d2c319..b6c6947e1 100644 --- a/src/share/vm/memory/metablock.cpp +++ b/src/share/vm/memory/metablock.cpp @@ -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 --git a/src/share/vm/memory/metablock.hpp b/src/share/vm/memory/metablock.hpp index 220d36148..fa4c6c0b4 100644 --- a/src/share/vm/memory/metablock.hpp +++ b/src/share/vm/memory/metablock.hpp @@ -48,7 +48,6 @@ class Metablock VALUE_OBJ_CLASS_SPEC { } _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 @@ class Metablock VALUE_OBJ_CLASS_SPEC { 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 --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp index 1dd97842e..9d7834a56 100644 --- a/src/share/vm/memory/metaspace.cpp +++ b/src/share/vm/memory/metaspace.cpp @@ -737,9 +737,7 @@ class SpaceManager : public CHeapObj { // 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; -- GitLab