equal
deleted
inserted
replaced
144 jint saved_current = _current_index; |
144 jint saved_current = _current_index; |
145 size_t index = (size_t)saved_current; |
145 size_t index = (size_t)saved_current; |
146 |
146 |
147 while(index < num_regions) { |
147 while(index < num_regions) { |
148 if (is_in(index)) { |
148 if (is_in(index)) { |
149 jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current); |
149 jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1)); |
150 assert(cur >= (jint)saved_current, "Must move forward"); |
150 assert(cur >= (jint)saved_current, "Must move forward"); |
151 if (cur == saved_current) { |
151 if (cur == saved_current) { |
152 assert(is_in(index), "Invariant"); |
152 assert(is_in(index), "Invariant"); |
153 return _heap->get_region(index); |
153 return _heap->get_region(index); |
154 } else { |
154 } else { |