equal
deleted
inserted
replaced
95 jint saved_current = _current_index; |
95 jint saved_current = _current_index; |
96 size_t index = (size_t)saved_current; |
96 size_t index = (size_t)saved_current; |
97 |
97 |
98 while(index < num_regions) { |
98 while(index < num_regions) { |
99 if (_set->is_in(index)) { |
99 if (_set->is_in(index)) { |
100 jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current); |
100 jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1)); |
101 assert(cur >= (jint)saved_current, "Must move forward"); |
101 assert(cur >= (jint)saved_current, "Must move forward"); |
102 if (cur == saved_current) { |
102 if (cur == saved_current) { |
103 assert(_set->is_in(index), "Invariant"); |
103 assert(_set->is_in(index), "Invariant"); |
104 return _heap->get_region(index); |
104 return _heap->get_region(index); |
105 } else { |
105 } else { |