8024651: Remove the incorrect usage of Metablock::overhead()

Fri, 13 Sep 2013 22:21:06 +0200

author
stefank
date
Fri, 13 Sep 2013 22:21:06 +0200
changeset 5705
335b388c4b28
parent 5704
c4c768305a8f
child 5706
9e11762cee52

8024651: Remove the incorrect usage of Metablock::overhead()
Reviewed-by: brutisso, mgerdin, coleenp, jmasa

src/share/vm/memory/metablock.cpp file | annotate | diff | comparison | revisions
src/share/vm/memory/metablock.hpp file | annotate | diff | comparison | revisions
src/share/vm/memory/metaspace.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/memory/metablock.cpp	Thu Sep 12 10:15:54 2013 +0200
     1.2 +++ b/src/share/vm/memory/metablock.cpp	Fri Sep 13 22:21:06 2013 +0200
     1.3 @@ -50,13 +50,6 @@
     1.4  // Chunks, change Chunks so that they can be allocated out of a VirtualSpace.
     1.5  size_t Metablock::_min_block_byte_size = sizeof(Metablock);
     1.6  
     1.7 -#ifdef ASSERT
     1.8 -size_t Metablock::_overhead =
     1.9 -  Chunk::aligned_overhead_size(sizeof(Metablock)) / BytesPerWord;
    1.10 -#else
    1.11 -size_t Metablock::_overhead = 0;
    1.12 -#endif
    1.13 -
    1.14  // New blocks returned by the Metaspace are zero initialized.
    1.15  // We should fix the constructors to not assume this instead.
    1.16  Metablock* Metablock::initialize(MetaWord* p, size_t word_size) {
     2.1 --- a/src/share/vm/memory/metablock.hpp	Thu Sep 12 10:15:54 2013 +0200
     2.2 +++ b/src/share/vm/memory/metablock.hpp	Fri Sep 13 22:21:06 2013 +0200
     2.3 @@ -48,7 +48,6 @@
     2.4      } _header;
     2.5    } _block;
     2.6    static size_t _min_block_byte_size;
     2.7 -  static size_t _overhead;
     2.8  
     2.9    typedef union block_t Block;
    2.10    typedef struct header_t Header;
    2.11 @@ -73,7 +72,6 @@
    2.12    void set_prev(Metablock* v) { _block._header._prev = v; }
    2.13  
    2.14    static size_t min_block_byte_size() { return _min_block_byte_size; }
    2.15 -  static size_t overhead() { return _overhead; }
    2.16  
    2.17    bool is_free()                 { return header()->_word_size != 0; }
    2.18    void clear_next()              { set_next(NULL); }
     3.1 --- a/src/share/vm/memory/metaspace.cpp	Thu Sep 12 10:15:54 2013 +0200
     3.2 +++ b/src/share/vm/memory/metaspace.cpp	Fri Sep 13 22:21:06 2013 +0200
     3.3 @@ -737,9 +737,7 @@
     3.4      // MinChunkSize is a placeholder for the real minimum size JJJ
     3.5      size_t byte_size = word_size * BytesPerWord;
     3.6  
     3.7 -    size_t byte_size_with_overhead = byte_size + Metablock::overhead();
     3.8 -
     3.9 -    size_t raw_bytes_size = MAX2(byte_size_with_overhead,
    3.10 +    size_t raw_bytes_size = MAX2(byte_size,
    3.11                                   Metablock::min_block_byte_size());
    3.12      raw_bytes_size = ARENA_ALIGN(raw_bytes_size);
    3.13      size_t raw_word_size = raw_bytes_size / BytesPerWord;

mercurial