equal
deleted
inserted
replaced
294 size_t capacity() { return _capacity; } |
294 size_t capacity() { return _capacity; } |
295 void set_capacity(size_t c) { _capacity = c; } |
295 void set_capacity(size_t c) { _capacity = c; } |
296 |
296 |
297 size_t end() { |
297 size_t end() { |
298 assert(_index <= capacity(), |
298 assert(_index <= capacity(), |
299 err_msg("_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT "): out of bounds", |
299 "_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT "): out of bounds", |
300 _index, _capacity)); |
300 _index, _capacity); |
301 return _index; |
301 return _index; |
302 } // exclusive |
302 } // exclusive |
303 |
303 |
304 HeapWord* nth(size_t n) { |
304 HeapWord* nth(size_t n) { |
305 assert(n < end(), "Out of bounds access"); |
305 assert(n < end(), "Out of bounds access"); |
320 if (_index < _capacity) { |
320 if (_index < _capacity) { |
321 _array[_index++] = p; |
321 _array[_index++] = p; |
322 } else { |
322 } else { |
323 ++_overflows; |
323 ++_overflows; |
324 assert(_index == _capacity, |
324 assert(_index == _capacity, |
325 err_msg("_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT |
325 "_index (" SIZE_FORMAT ") > _capacity (" SIZE_FORMAT |
326 "): out of bounds at overflow#" SIZE_FORMAT, |
326 "): out of bounds at overflow#" SIZE_FORMAT, |
327 _index, _capacity, _overflows)); |
327 _index, _capacity, _overflows); |
328 } |
328 } |
329 } |
329 } |
330 }; |
330 }; |
331 |
331 |
332 // |
332 // |