src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp
changeset 52124 c64384f414bc
parent 51817 46eac084082d
child 52854 eb4f89bce401
equal deleted inserted replaced
52123:e5adee94d20d 52124:c64384f414bc
    24 
    24 
    25 #ifndef SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
    25 #ifndef SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
    26 #define SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
    26 #define SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
    27 
    27 
    28 #include "gc/shared/gcUtil.hpp"
    28 #include "gc/shared/gcUtil.hpp"
    29 #include "oops/typeArrayOop.hpp"
       
    30 #include "runtime/perfData.hpp"
    29 #include "runtime/perfData.hpp"
    31 #include "runtime/vm_version.hpp"
    30 #include "runtime/vm_version.hpp"
    32 
    31 
    33 class ThreadLocalAllocStats;
    32 class ThreadLocalAllocStats;
    34 
    33 
   136 
   135 
   137   // Allocate size HeapWords. The memory is NOT initialized to zero.
   136   // Allocate size HeapWords. The memory is NOT initialized to zero.
   138   inline HeapWord* allocate(size_t size);
   137   inline HeapWord* allocate(size_t size);
   139 
   138 
   140   // Reserve space at the end of TLAB
   139   // Reserve space at the end of TLAB
   141   static size_t end_reserve() {
   140   static size_t end_reserve();
   142     int reserve_size = typeArrayOopDesc::header_size(T_INT);
       
   143     return MAX2(reserve_size, _reserve_for_allocation_prefetch);
       
   144   }
       
   145   static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
   141   static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
   146   static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
   142   static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
   147 
   143 
   148   // Return tlab size or remaining space in eden such that the
   144   // Return tlab size or remaining space in eden such that the
   149   // space is large enough to hold obj_size and necessary fill space.
   145   // space is large enough to hold obj_size and necessary fill space.