src/share/vm/memory/metachunk.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hsx-gc Sdiff src/share/vm/memory

src/share/vm/memory/metachunk.cpp

Print this page




  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 #include "precompiled.hpp"
  26 #include "memory/allocation.hpp"
  27 #include "memory/metachunk.hpp"
  28 #include "utilities/copy.hpp"
  29 #include "utilities/debug.hpp"
  30 
  31 class VirtualSpaceNode;
  32 
  33 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
  34 
  35 size_t Metachunk::object_alignment() {
  36   return ARENA_AMALLOC_ALIGNMENT;







  37 }
  38 
  39 size_t Metachunk::overhead() {
  40   return align_size_up(sizeof(Metachunk), object_alignment()) / BytesPerWord;
  41 }
  42 
  43 // Metachunk methods
  44 
  45 Metachunk::Metachunk(size_t word_size,
  46                      VirtualSpaceNode* container)
  47     : Metamem<Metachunk>(word_size),
  48     _top(NULL),
  49     _container(container)
  50 {
  51   _top = initial_top();
  52 #ifdef ASSERT
  53   set_is_marked_free(false);
  54   size_t data_word_size = pointer_delta(end(),
  55                                         _top,
  56                                                                                 sizeof(MetaWord));




  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 #include "precompiled.hpp"
  26 #include "memory/allocation.hpp"
  27 #include "memory/metachunk.hpp"
  28 #include "utilities/copy.hpp"
  29 #include "utilities/debug.hpp"
  30 
  31 class VirtualSpaceNode;
  32 
  33 const size_t metadata_chunk_initialize = 0xf7f7f7f7;
  34 
  35 size_t Metachunk::object_alignment() {
  36   // Must align pointers and sizes to 8,
  37   // so that 64 bit types get correctly aligned.
  38   const size_t alignment = 8;
  39 
  40   STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
  41   STATIC_ASSERT(alignment == (size_t)BytesPerLong);
  42 
  43   return alignment;
  44 }
  45 
  46 size_t Metachunk::overhead() {
  47   return align_size_up(sizeof(Metachunk), object_alignment()) / BytesPerWord;
  48 }
  49 
  50 // Metachunk methods
  51 
  52 Metachunk::Metachunk(size_t word_size,
  53                      VirtualSpaceNode* container)
  54     : Metamem<Metachunk>(word_size),
  55     _top(NULL),
  56     _container(container)
  57 {
  58   _top = initial_top();
  59 #ifdef ASSERT
  60   set_is_marked_free(false);
  61   size_t data_word_size = pointer_delta(end(),
  62                                         _top,
  63                                                                                 sizeof(MetaWord));


src/share/vm/memory/metachunk.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File