< prev index next >

src/hotspot/share/memory/metaspace/virtualSpaceList.hpp

Print this page
rev 50187 : imported patch metaspace-split
rev 50188 : [mq]: 8176808-split-metaspace-cpp-2


  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_
  26 #define SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_
  27 
  28 #include "memory/allocation.hpp"
  29 #include "memory/metaspace/virtualSpaceNode.hpp"
  30 #include "utilities/globalDefinitions.hpp"
  31 
  32 
  33 namespace metaspace {
  34 namespace internals {
  35 
  36 class Metachunk;
  37 class ChunkManager;
  38 
  39 // List of VirtualSpaces for metadata allocation.
  40 class VirtualSpaceList : public CHeapObj<mtClass> {
  41   friend class VirtualSpaceNode;
  42 
  43   enum VirtualSpaceSizes {
  44     VirtualSpaceSize = 256 * K
  45   };
  46 
  47   // Head of the list
  48   VirtualSpaceNode* _virtual_space_list;
  49   // virtual space currently being used for allocations
  50   VirtualSpaceNode* _current_virtual_space;
  51 
  52   // Is this VirtualSpaceList used for the compressed class space
  53   bool _is_class;
  54 


 130     VirtualSpaceNode* _virtual_spaces;
 131    public:
 132     VirtualSpaceListIterator(VirtualSpaceNode* virtual_spaces) :
 133       _virtual_spaces(virtual_spaces) {}
 134 
 135     bool repeat() {
 136       return _virtual_spaces != NULL;
 137     }
 138 
 139     VirtualSpaceNode* get_next() {
 140       VirtualSpaceNode* result = _virtual_spaces;
 141       if (_virtual_spaces != NULL) {
 142         _virtual_spaces = _virtual_spaces->next();
 143       }
 144       return result;
 145     }
 146   };
 147 };
 148 
 149 } // namespace metaspace
 150 } // namespace internals
 151 
 152 #endif /* SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_ */



  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_
  26 #define SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_
  27 
  28 #include "memory/allocation.hpp"
  29 #include "memory/metaspace/virtualSpaceNode.hpp"
  30 #include "utilities/globalDefinitions.hpp"
  31 
  32 
  33 namespace metaspace {

  34 
  35 class Metachunk;
  36 class ChunkManager;
  37 
  38 // List of VirtualSpaces for metadata allocation.
  39 class VirtualSpaceList : public CHeapObj<mtClass> {
  40   friend class VirtualSpaceNode;
  41 
  42   enum VirtualSpaceSizes {
  43     VirtualSpaceSize = 256 * K
  44   };
  45 
  46   // Head of the list
  47   VirtualSpaceNode* _virtual_space_list;
  48   // virtual space currently being used for allocations
  49   VirtualSpaceNode* _current_virtual_space;
  50 
  51   // Is this VirtualSpaceList used for the compressed class space
  52   bool _is_class;
  53 


 129     VirtualSpaceNode* _virtual_spaces;
 130    public:
 131     VirtualSpaceListIterator(VirtualSpaceNode* virtual_spaces) :
 132       _virtual_spaces(virtual_spaces) {}
 133 
 134     bool repeat() {
 135       return _virtual_spaces != NULL;
 136     }
 137 
 138     VirtualSpaceNode* get_next() {
 139       VirtualSpaceNode* result = _virtual_spaces;
 140       if (_virtual_spaces != NULL) {
 141         _virtual_spaces = _virtual_spaces->next();
 142       }
 143       return result;
 144     }
 145   };
 146 };
 147 
 148 } // namespace metaspace

 149 
 150 #endif /* SHARE_MEMORY_METASPACE_VIRTUALSPACELIST_HPP_ */
 151 
< prev index next >