< prev index next >

src/share/vm/memory/metachunk.cpp

Print this page




   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 
  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 size_t Metachunk::object_alignment() {
  34   // Must align pointers and sizes to 8,
  35   // so that 64 bit types get correctly aligned.
  36   const size_t alignment = 8;
  37 
  38   // Make sure that the Klass alignment also agree.
  39   STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
  40 
  41   return alignment;
  42 }
  43 
  44 size_t Metachunk::overhead() {
  45   return align_up(sizeof(Metachunk), object_alignment()) / BytesPerWord;
  46 }
  47 




   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 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.hpp"
  27 #include "memory/metachunk.hpp"
  28 #include "utilities/align.hpp"
  29 #include "utilities/copy.hpp"
  30 #include "utilities/debug.hpp"
  31 
  32 class VirtualSpaceNode;
  33 
  34 size_t Metachunk::object_alignment() {
  35   // Must align pointers and sizes to 8,
  36   // so that 64 bit types get correctly aligned.
  37   const size_t alignment = 8;
  38 
  39   // Make sure that the Klass alignment also agree.
  40   STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes);
  41 
  42   return alignment;
  43 }
  44 
  45 size_t Metachunk::overhead() {
  46   return align_up(sizeof(Metachunk), object_alignment()) / BytesPerWord;
  47 }
  48 


< prev index next >