Lines Matching refs:capacity
21 // pushes and pops will be constant time as long as a capacity expansion is
83 // size_t capacity() const;
124 // external capacity so the internal buffer will be one larger (= 4) which is
126 // capacity on the comment above the buffer_ variable below.
251 return parent_deque_->buffer_.capacity() - parent_deque_->begin_ + index_;
259 if (index_ == parent_deque_->buffer_.capacity())
266 index_ = parent_deque_->buffer_.capacity() - 1;
280 // by 0 if the buffer capacity is empty, so it's important to check for
289 parent_deque_->buffer_.capacity();
517 size_t right_size = buffer_.capacity() - begin_;
579 // elements, but pop an element before the queue is full, the capacity you
585 if (new_capacity > capacity())
589 size_type capacity() const {
591 return buffer_.capacity() == 0 ? 0 : buffer_.capacity() - 1;
598 if (buffer_.capacity())
608 // This will additionally reset the capacity() to 0.
621 return buffer_.capacity() - begin_ + end_;
646 size_t new_end = (begin_ + count) % buffer_.capacity();
661 size_t new_end = (begin_ + count) % buffer_.capacity();
727 (begin_ + buffer_.capacity() - inserted_items) % buffer_.capacity();
778 // to resize capacity downward to a new buffer.
797 &buffer_[buffer_.capacity()]);
840 begin_ = buffer_.capacity() - 1;
852 if (end_ == buffer_.capacity() - 1)
864 if (begin_ == buffer_.capacity())
878 end_ = buffer_.capacity() - 1;
914 size_t from_capacity = from_buf.capacity();
940 // Use the capacity + 1 as the internal buffer size to differentiate
948 if (capacity() >= min_new_capacity)
958 std::max(min_new_capacity, capacity() + capacity() / 4);
964 if (capacity() <= internal::kCircularBufferInitialCapacity)
969 size_t empty_spaces = capacity() - sz;
973 // Leave 1/4 the size as free capacity, not going below the initial
974 // capacity.
977 if (new_capacity < capacity()) {
978 // Count extra item to convert to internal capacity.
1002 buffer_.DestructRange(&buffer_[begin], &buffer_[buffer_.capacity()]);
1021 insert_begin->index_ = (begin_ + begin_offset) % buffer_.capacity();
1023 iterator(this, (insert_begin->index_ + count) % buffer_.capacity());
1027 end_ = (end_ + count) % buffer_.capacity();
1050 DCHECK((i >= begin_ && i < buffer_.capacity()) || i < end_);
1074 // Danger, the buffer_.capacity() is the "internal capacity" which is
1075 // capacity() + 1 since there is an extra item to indicate the end. Otherwise
1082 // Container internal code will want to use buffer_.capacity() for offset
1083 // computations rather than capacity().