hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp
changeset 6183 4c74cfe14f20
parent 5547 f4b087cbb361
child 7397 5b173b4ca846
equal deleted inserted replaced
6182:685deffe44a5 6183:4c74cfe14f20
   156 
   156 
   157 CollectionSetChooser::CollectionSetChooser() :
   157 CollectionSetChooser::CollectionSetChooser() :
   158   // The line below is the worst bit of C++ hackery I've ever written
   158   // The line below is the worst bit of C++ hackery I've ever written
   159   // (Detlefs, 11/23).  You should think of it as equivalent to
   159   // (Detlefs, 11/23).  You should think of it as equivalent to
   160   // "_regions(100, true)": initialize the growable array and inform it
   160   // "_regions(100, true)": initialize the growable array and inform it
   161   // that it should allocate its elem array(s) on the C heap.  The first
   161   // that it should allocate its elem array(s) on the C heap.
   162   // argument, however, is actually a comma expression (new-expr, 100).
   162   //
   163   // The purpose of the new_expr is to inform the growable array that it
   163   // The first argument, however, is actually a comma expression
   164   // is *already* allocated on the C heap: it uses the placement syntax to
   164   // (set_allocation_type(this, C_HEAP), 100). The purpose of the
   165   // keep it from actually doing any allocation.
   165   // set_allocation_type() call is to replace the default allocation
   166   _markedRegions((ResourceObj::operator new (sizeof(GrowableArray<HeapRegion*>),
   166   // type for embedded objects STACK_OR_EMBEDDED with C_HEAP. It will
   167                                              (void*)&_markedRegions,
   167   // allow to pass the assert in GenericGrowableArray() which checks
       
   168   // that a growable array object must be on C heap if elements are.
       
   169   //
       
   170   // Note: containing object is allocated on C heap since it is CHeapObj.
       
   171   //
       
   172   _markedRegions((ResourceObj::set_allocation_type((address)&_markedRegions,
   168                                              ResourceObj::C_HEAP),
   173                                              ResourceObj::C_HEAP),
   169                   100),
   174                   100),
   170                  true),
   175                  true),
   171   _curMarkedIndex(0),
   176   _curMarkedIndex(0),
   172   _numMarkedRegions(0),
   177   _numMarkedRegions(0),