< prev index next >

src/hotspot/share/memory/metachunk.hpp

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 #ifndef SHARE_VM_MEMORY_METACHUNK_HPP
  25 #define SHARE_VM_MEMORY_METACHUNK_HPP
  26 
  27 #include "memory/allocation.hpp"
  28 #include "utilities/debug.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 
  31 class VirtualSpaceNode;
  32 
  33 // Super class of Metablock and Metachunk to allow them to
  34 // be put on the FreeList and in the BinaryTreeDictionary.
  35 template <class T>
  36 class Metabase {
  37   size_t _word_size;
  38   T*     _next;
  39   T*     _prev;
  40 
  41  protected:
  42   Metabase(size_t word_size) : _word_size(word_size), _next(NULL), _prev(NULL) {}
  43 
  44  public:
  45   T* next() const         { return _next; }
  46   T* prev() const         { return _prev; }
  47   void set_next(T* v)     { _next = v; assert(v != this, "Boom");}




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 #ifndef SHARE_VM_MEMORY_METACHUNK_HPP
  25 #define SHARE_VM_MEMORY_METACHUNK_HPP
  26 

  27 #include "utilities/debug.hpp"
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 class VirtualSpaceNode;
  31 
  32 // Super class of Metablock and Metachunk to allow them to
  33 // be put on the FreeList and in the BinaryTreeDictionary.
  34 template <class T>
  35 class Metabase {
  36   size_t _word_size;
  37   T*     _next;
  38   T*     _prev;
  39 
  40  protected:
  41   Metabase(size_t word_size) : _word_size(word_size), _next(NULL), _prev(NULL) {}
  42 
  43  public:
  44   T* next() const         { return _next; }
  45   T* prev() const         { return _prev; }
  46   void set_next(T* v)     { _next = v; assert(v != this, "Boom");}


< prev index next >