< prev index next >

src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp

Print this page

212 #endif
213   InternalStats::inc_num_space_uncommitted();
214 }
215 
216 //// creation, destruction ////
217 
218 VirtualSpaceNode::VirtualSpaceNode(ReservedSpace rs, bool owns_rs, CommitLimiter* limiter,
219                                    SizeCounter* reserve_counter, SizeCounter* commit_counter) :
220   _next(nullptr),
221   _rs(rs),
222   _owns_rs(owns_rs),
223   _base((MetaWord*)rs.base()),
224   _word_size(rs.size() / BytesPerWord),
225   _used_words(0),
226   _commit_mask((MetaWord*)rs.base(), rs.size() / BytesPerWord),
227   _root_chunk_area_lut((MetaWord*)rs.base(), rs.size() / BytesPerWord),
228   _commit_limiter(limiter),
229   _total_reserved_words_counter(reserve_counter),
230   _total_committed_words_counter(commit_counter)
231 {
232   UL2(debug, "born (word_size " SIZE_FORMAT ").", _word_size);

233 
234   // Update reserved counter in vslist
235   _total_reserved_words_counter->increment_by(_word_size);
236 
237   assert_is_aligned(_base, chunklevel::MAX_CHUNK_BYTE_SIZE);
238   assert_is_aligned(_word_size, chunklevel::MAX_CHUNK_WORD_SIZE);
239 
240   // Poison the memory region. It will be unpoisoned later on a per-chunk base for chunks that are
241   // handed to arenas.
242   ASAN_POISON_MEMORY_REGION(rs.base(), rs.size());
243 
244   // Register memory region related to Metaspace. The Metaspace contains lots of pointers to malloc
245   // memory.
246   LSAN_REGISTER_ROOT_REGION(rs.base(), rs.size());
247 }
248 
249 // Create a node of a given size (it will create its own space).
250 VirtualSpaceNode* VirtualSpaceNode::create_node(size_t word_size,
251                                                 CommitLimiter* limiter, SizeCounter* reserve_words_counter,
252                                                 SizeCounter* commit_words_counter)

212 #endif
213   InternalStats::inc_num_space_uncommitted();
214 }
215 
216 //// creation, destruction ////
217 
218 VirtualSpaceNode::VirtualSpaceNode(ReservedSpace rs, bool owns_rs, CommitLimiter* limiter,
219                                    SizeCounter* reserve_counter, SizeCounter* commit_counter) :
220   _next(nullptr),
221   _rs(rs),
222   _owns_rs(owns_rs),
223   _base((MetaWord*)rs.base()),
224   _word_size(rs.size() / BytesPerWord),
225   _used_words(0),
226   _commit_mask((MetaWord*)rs.base(), rs.size() / BytesPerWord),
227   _root_chunk_area_lut((MetaWord*)rs.base(), rs.size() / BytesPerWord),
228   _commit_limiter(limiter),
229   _total_reserved_words_counter(reserve_counter),
230   _total_committed_words_counter(commit_counter)
231 {
232   UL2(debug, "born: [" PTR_FORMAT ".." PTR_FORMAT "), (word_size " SIZE_FORMAT ").",
233       p2i(_rs.base()), p2i(_rs.end()), _word_size);
234 
235   // Update reserved counter in vslist
236   _total_reserved_words_counter->increment_by(_word_size);
237 
238   assert_is_aligned(_base, chunklevel::MAX_CHUNK_BYTE_SIZE);
239   assert_is_aligned(_word_size, chunklevel::MAX_CHUNK_WORD_SIZE);
240 
241   // Poison the memory region. It will be unpoisoned later on a per-chunk base for chunks that are
242   // handed to arenas.
243   ASAN_POISON_MEMORY_REGION(rs.base(), rs.size());
244 
245   // Register memory region related to Metaspace. The Metaspace contains lots of pointers to malloc
246   // memory.
247   LSAN_REGISTER_ROOT_REGION(rs.base(), rs.size());
248 }
249 
250 // Create a node of a given size (it will create its own space).
251 VirtualSpaceNode* VirtualSpaceNode::create_node(size_t word_size,
252                                                 CommitLimiter* limiter, SizeCounter* reserve_words_counter,
253                                                 SizeCounter* commit_words_counter)
< prev index next >