equal
deleted
inserted
replaced
552 inline HeapWord* ContiguousSpace::par_allocate_impl(size_t size) { |
552 inline HeapWord* ContiguousSpace::par_allocate_impl(size_t size) { |
553 do { |
553 do { |
554 HeapWord* obj = top(); |
554 HeapWord* obj = top(); |
555 if (pointer_delta(end(), obj) >= size) { |
555 if (pointer_delta(end(), obj) >= size) { |
556 HeapWord* new_top = obj + size; |
556 HeapWord* new_top = obj + size; |
557 HeapWord* result = Atomic::cmpxchg(new_top, top_addr(), obj); |
557 HeapWord* result = Atomic::cmpxchg(top_addr(), obj, new_top); |
558 // result can be one of two: |
558 // result can be one of two: |
559 // the old top value: the exchange succeeded |
559 // the old top value: the exchange succeeded |
560 // otherwise: the new value of the top is returned. |
560 // otherwise: the new value of the top is returned. |
561 if (result == obj) { |
561 if (result == obj) { |
562 assert(is_aligned(obj) && is_aligned(new_top), "checking alignment"); |
562 assert(is_aligned(obj) && is_aligned(new_top), "checking alignment"); |