hotspot/src/share/vm/gc/parallel/mutableSpace.cpp
changeset 46565 8dcbf532ea00
parent 40655 9f644073d3a0
child 46619 a3919f5e8d2b
equal deleted inserted replaced
46564:0ec329b23bbf 46565:8dcbf532ea00
   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_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top),
   180     assert(is_ptr_object_aligned(obj) && is_ptr_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_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top),
   201       assert(is_ptr_object_aligned(obj) && is_ptr_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     }