hotspot/src/share/vm/gc/parallel/mutableSpace.cpp
changeset 46619 a3919f5e8d2b
parent 46565 8dcbf532ea00
child 46620 750c6edff33b
equal deleted inserted replaced
46618:d503911aa948 46619:a3919f5e8d2b
   175          "not locked");
   175          "not locked");
   176   HeapWord* obj = top();
   176   HeapWord* obj = top();
   177   if (pointer_delta(end(), obj) >= size) {
   177   if (pointer_delta(end(), obj) >= size) {
   178     HeapWord* new_top = obj + size;
   178     HeapWord* new_top = obj + size;
   179     set_top(new_top);
   179     set_top(new_top);
   180     assert(is_ptr_object_aligned(obj) && is_ptr_object_aligned(new_top),
   180     assert(is_object_aligned(obj) && is_object_aligned(new_top),
   181            "checking alignment");
   181            "checking alignment");
   182     return obj;
   182     return obj;
   183   } else {
   183   } else {
   184     return NULL;
   184     return NULL;
   185   }
   185   }
   196       //  the old top value: the exchange succeeded
   196       //  the old top value: the exchange succeeded
   197       //  otherwise: the new value of the top is returned.
   197       //  otherwise: the new value of the top is returned.
   198       if (result != obj) {
   198       if (result != obj) {
   199         continue; // another thread beat us to the allocation, try again
   199         continue; // another thread beat us to the allocation, try again
   200       }
   200       }
   201       assert(is_ptr_object_aligned(obj) && is_ptr_object_aligned(new_top),
   201       assert(is_object_aligned(obj) && is_object_aligned(new_top),
   202              "checking alignment");
   202              "checking alignment");
   203       return obj;
   203       return obj;
   204     } else {
   204     } else {
   205       return NULL;
   205       return NULL;
   206     }
   206     }