src/hotspot/share/memory/metaspace/chunkManager.hpp
changeset 50380 bec342339138
parent 50193 49c3e91c424f
child 52363 7e236f262add
equal deleted inserted replaced
50377:1d476feca3c9 50380:bec342339138
    25 #ifndef SHARE_MEMORY_METASPACE_CHUNKMANAGER_HPP
    25 #ifndef SHARE_MEMORY_METASPACE_CHUNKMANAGER_HPP
    26 #define SHARE_MEMORY_METASPACE_CHUNKMANAGER_HPP
    26 #define SHARE_MEMORY_METASPACE_CHUNKMANAGER_HPP
    27 
    27 
    28 #include "memory/allocation.hpp"
    28 #include "memory/allocation.hpp"
    29 #include "memory/binaryTreeDictionary.hpp"
    29 #include "memory/binaryTreeDictionary.hpp"
    30 #include "memory/freeList.inline.hpp"
    30 #include "memory/freeList.hpp"
    31 #include "memory/metaspace/metachunk.hpp"
    31 #include "memory/metaspace/metachunk.hpp"
    32 #include "memory/metaspace/metaspaceStatistics.hpp"
    32 #include "memory/metaspace/metaspaceStatistics.hpp"
    33 #include "memory/metaspaceChunkFreeListSummary.hpp"
    33 #include "memory/metaspaceChunkFreeListSummary.hpp"
    34 #include "utilities/globalDefinitions.hpp"
    34 #include "utilities/globalDefinitions.hpp"
    35 
    35 
   113   // Note that this chunk is supposed to be removed from the freelist right away.
   113   // Note that this chunk is supposed to be removed from the freelist right away.
   114   Metachunk* split_chunk(size_t target_chunk_word_size, Metachunk* chunk);
   114   Metachunk* split_chunk(size_t target_chunk_word_size, Metachunk* chunk);
   115 
   115 
   116  public:
   116  public:
   117 
   117 
   118   ChunkManager(bool is_class)
   118   ChunkManager(bool is_class);
   119       : _is_class(is_class), _free_chunks_total(0), _free_chunks_count(0) {
       
   120     _free_chunks[SpecializedIndex].set_size(get_size_for_nonhumongous_chunktype(SpecializedIndex, is_class));
       
   121     _free_chunks[SmallIndex].set_size(get_size_for_nonhumongous_chunktype(SmallIndex, is_class));
       
   122     _free_chunks[MediumIndex].set_size(get_size_for_nonhumongous_chunktype(MediumIndex, is_class));
       
   123   }
       
   124 
   119 
   125   // Add or delete (return) a chunk to the global freelist.
   120   // Add or delete (return) a chunk to the global freelist.
   126   Metachunk* chunk_freelist_allocate(size_t word_size);
   121   Metachunk* chunk_freelist_allocate(size_t word_size);
   127 
   122 
   128   // Map a size to a list index assuming that there are lists
   123   // Map a size to a list index assuming that there are lists