src/share/vm/memory/space.inline.hpp

Print this page




  50   // This ought to be just "allocate", because of the lock above, but that
  51   // ContiguousSpace::allocate asserts that either the allocating thread
  52   // holds the heap lock or it is the VM thread and we're at a safepoint.
  53   // The best I (dld) could figure was to put a field in ContiguousSpace
  54   // meaning "locking at safepoint taken care of", and set/reset that
  55   // here.  But this will do for now, especially in light of the comment
  56   // above.  Perhaps in the future some lock-free manner of keeping the
  57   // coordination.
  58   HeapWord* res = ContiguousSpace::par_allocate(size);
  59   if (res != NULL) {
  60     _offsets.alloc_block(res, size);
  61   }
  62   return res;
  63 }
  64 
  65 inline HeapWord*
  66 OffsetTableContigSpace::block_start_const(const void* p) const {
  67   return _offsets.block_start(p);
  68 }
  69 
  70 inline HeapWord* ContiguousSpace::concurrent_iteration_safe_limit()
  71 {
  72   assert(_concurrent_iteration_safe_limit <= top(),
  73          "_concurrent_iteration_safe_limit update missed");
  74   return _concurrent_iteration_safe_limit;
  75 }
  76 
  77 inline void ContiguousSpace::set_concurrent_iteration_safe_limit(HeapWord* new_limit)
  78 {
  79   assert(new_limit <= top(), "uninitialized objects in the safe range");
  80   _concurrent_iteration_safe_limit = new_limit;
  81 }
  82 
  83 #endif // SHARE_VM_MEMORY_SPACE_INLINE_HPP


  50   // This ought to be just "allocate", because of the lock above, but that
  51   // ContiguousSpace::allocate asserts that either the allocating thread
  52   // holds the heap lock or it is the VM thread and we're at a safepoint.
  53   // The best I (dld) could figure was to put a field in ContiguousSpace
  54   // meaning "locking at safepoint taken care of", and set/reset that
  55   // here.  But this will do for now, especially in light of the comment
  56   // above.  Perhaps in the future some lock-free manner of keeping the
  57   // coordination.
  58   HeapWord* res = ContiguousSpace::par_allocate(size);
  59   if (res != NULL) {
  60     _offsets.alloc_block(res, size);
  61   }
  62   return res;
  63 }
  64 
  65 inline HeapWord*
  66 OffsetTableContigSpace::block_start_const(const void* p) const {
  67   return _offsets.block_start(p);
  68 }
  69 













  70 #endif // SHARE_VM_MEMORY_SPACE_INLINE_HPP