src/hotspot/share/gc/g1/heapRegion.inline.hpp
changeset 59252 623722a6aeb9
parent 59218 a1155217a563
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    59     HeapWord* obj = top();
    59     HeapWord* obj = top();
    60     size_t available = pointer_delta(end(), obj);
    60     size_t available = pointer_delta(end(), obj);
    61     size_t want_to_allocate = MIN2(available, desired_word_size);
    61     size_t want_to_allocate = MIN2(available, desired_word_size);
    62     if (want_to_allocate >= min_word_size) {
    62     if (want_to_allocate >= min_word_size) {
    63       HeapWord* new_top = obj + want_to_allocate;
    63       HeapWord* new_top = obj + want_to_allocate;
    64       HeapWord* result = Atomic::cmpxchg(new_top, &_top, obj);
    64       HeapWord* result = Atomic::cmpxchg(&_top, obj, new_top);
    65       // result can be one of two:
    65       // result can be one of two:
    66       //  the old top value: the exchange succeeded
    66       //  the old top value: the exchange succeeded
    67       //  otherwise: the new value of the top is returned.
    67       //  otherwise: the new value of the top is returned.
    68       if (result == obj) {
    68       if (result == obj) {
    69         assert(is_object_aligned(obj) && is_object_aligned(new_top), "checking alignment");
    69         assert(is_object_aligned(obj) && is_object_aligned(new_top), "checking alignment");