mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8024651: Remove the incorrect usage of Metablock::overhead()
Reviewed-by: brutisso, mgerdin, coleenp, jmasa
This commit is contained in:
parent
8a515de48c
commit
d2d4036f85
3 changed files with 1 additions and 12 deletions
|
@ -50,13 +50,6 @@
|
||||||
// Chunks, change Chunks so that they can be allocated out of a VirtualSpace.
|
// Chunks, change Chunks so that they can be allocated out of a VirtualSpace.
|
||||||
size_t Metablock::_min_block_byte_size = sizeof(Metablock);
|
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.
|
// New blocks returned by the Metaspace are zero initialized.
|
||||||
// We should fix the constructors to not assume this instead.
|
// We should fix the constructors to not assume this instead.
|
||||||
Metablock* Metablock::initialize(MetaWord* p, size_t word_size) {
|
Metablock* Metablock::initialize(MetaWord* p, size_t word_size) {
|
||||||
|
|
|
@ -48,7 +48,6 @@ class Metablock VALUE_OBJ_CLASS_SPEC {
|
||||||
} _header;
|
} _header;
|
||||||
} _block;
|
} _block;
|
||||||
static size_t _min_block_byte_size;
|
static size_t _min_block_byte_size;
|
||||||
static size_t _overhead;
|
|
||||||
|
|
||||||
typedef union block_t Block;
|
typedef union block_t Block;
|
||||||
typedef struct header_t Header;
|
typedef struct header_t Header;
|
||||||
|
@ -73,7 +72,6 @@ class Metablock VALUE_OBJ_CLASS_SPEC {
|
||||||
void set_prev(Metablock* v) { _block._header._prev = v; }
|
void set_prev(Metablock* v) { _block._header._prev = v; }
|
||||||
|
|
||||||
static size_t min_block_byte_size() { return _min_block_byte_size; }
|
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; }
|
bool is_free() { return header()->_word_size != 0; }
|
||||||
void clear_next() { set_next(NULL); }
|
void clear_next() { set_next(NULL); }
|
||||||
|
|
|
@ -737,9 +737,7 @@ class SpaceManager : public CHeapObj<mtClass> {
|
||||||
// MinChunkSize is a placeholder for the real minimum size JJJ
|
// MinChunkSize is a placeholder for the real minimum size JJJ
|
||||||
size_t byte_size = word_size * BytesPerWord;
|
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,
|
||||||
|
|
||||||
size_t raw_bytes_size = MAX2(byte_size_with_overhead,
|
|
||||||
Metablock::min_block_byte_size());
|
Metablock::min_block_byte_size());
|
||||||
raw_bytes_size = ARENA_ALIGN(raw_bytes_size);
|
raw_bytes_size = ARENA_ALIGN(raw_bytes_size);
|
||||||
size_t raw_word_size = raw_bytes_size / BytesPerWord;
|
size_t raw_word_size = raw_bytes_size / BytesPerWord;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue