src/hotspot/share/gc/shared/space.cpp
changeset 59252 623722a6aeb9
parent 59154 0c2e1808f800
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   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");