equal
deleted
inserted
replaced
38 #include "utilities/globalDefinitions.hpp" |
38 #include "utilities/globalDefinitions.hpp" |
39 #include "utilities/ostream.hpp" |
39 #include "utilities/ostream.hpp" |
40 |
40 |
41 namespace metaspace { |
41 namespace metaspace { |
42 |
42 |
|
43 ChunkManager::ChunkManager(bool is_class) |
|
44 : _is_class(is_class), _free_chunks_total(0), _free_chunks_count(0) { |
|
45 _free_chunks[SpecializedIndex].set_size(get_size_for_nonhumongous_chunktype(SpecializedIndex, is_class)); |
|
46 _free_chunks[SmallIndex].set_size(get_size_for_nonhumongous_chunktype(SmallIndex, is_class)); |
|
47 _free_chunks[MediumIndex].set_size(get_size_for_nonhumongous_chunktype(MediumIndex, is_class)); |
|
48 } |
|
49 |
43 void ChunkManager::remove_chunk(Metachunk* chunk) { |
50 void ChunkManager::remove_chunk(Metachunk* chunk) { |
44 size_t word_size = chunk->word_size(); |
51 size_t word_size = chunk->word_size(); |
45 ChunkIndex index = list_index(word_size); |
52 ChunkIndex index = list_index(word_size); |
46 if (index != HumongousIndex) { |
53 if (index != HumongousIndex) { |
47 free_chunks(index)->remove_chunk(chunk); |
54 free_chunks(index)->remove_chunk(chunk); |