Lines Matching defs:reserve

6587     v.reserve(2);
6595 v.reserve(16);
6600 v.reserve(16);
8251 v.reserve(32);
11450 d.reserve(50);
11972 ring.reserve(7);
11987 ring.reserve(7);
12002 ring.reserve(7);
14718 /// self.buf.reserve(self.len, elems.len());
14719 /// // reserve would have aborted or panicked if the len exceeded
14735 pub fn reserve(&mut self, len: usize, additional: usize) {
14754 /// The same as `reserve`, but returns on errors instead of panicking or aborting.
14810 /// Mainly used to make inlining reserve-calls possible without inlining `grow`.
14936 // Central function for reserve error handling.
17037 /// s.reserve(10);
17054 /// s.reserve(8);
17061 pub fn reserve(&mut self, additional: usize) {
17062 self.vec.reserve(additional)
17068 /// Consider using the [`reserve`] method unless you absolutely know
17071 /// [`reserve`]: String::reserve
17112 /// Tries to reserve capacity for at least `additional` more elements to be inserted
17113 /// in the given `String`. The collection may reserve more space to avoid
17114 /// frequent reallocations. After calling `reserve`, capacity will be
17132 /// // Pre-reserve the memory, exiting if we can't
17147 /// Tries to reserve the minimum capacity for exactly `additional` more elements to
17154 /// minimal. Prefer `reserve` if future insertions are expected.
17170 /// // Pre-reserve the memory, exiting if we can't
17194 /// s.reserve(100);
17219 /// s.reserve(100);
17541 self.vec.reserve(amt);
18011 self.reserve(lower_bound);
18022 self.reserve(additional);
18039 self.reserve(additional);
40947 /// capacity can not be relied upon to be precisely minimal. Prefer [`reserve`] if future
40964 /// [`reserve`]: VecDeque::reserve
40967 self.reserve(additional);
40971 /// `VecDeque`. The collection may reserve more space to avoid frequent reallocations.
40983 /// buf.reserve(10);
40987 pub fn reserve(&mut self, additional: usize) {
41003 /// Tries to reserve the minimum capacity for exactly `additional` more elements to
41010 /// minimal. Prefer `reserve` if future insertions are expected.
41027 /// // Pre-reserve the memory, exiting if we can't
41044 /// Tries to reserve capacity for at least `additional` more elements to be inserted
41045 /// in the given `VecDeque<T>`. The collection may reserve more space to avoid
41065 /// // Pre-reserve the memory, exiting if we can't
43153 self.reserve(lower.saturating_add(1));
43171 self.reserve(additional);
43188 self.reserve(additional);
43846 tester.reserve(63);
43855 tester.reserve(63);
45158 /// capacity can not be relied upon to be precisely minimal. Prefer [`reserve`] if future
45177 /// [`reserve`]: BinaryHeap::reserve
45184 /// `BinaryHeap`. The collection may reserve more space to avoid frequent reallocations.
45197 /// heap.reserve(100);
45202 pub fn reserve(&mut self, additional: usize) {
45203 self.data.reserve(additional);
45804 self.reserve(additional);
45825 self.reserve(lower);
45844 self.reserve(additional);
46172 self.reserve(additional);
46186 // Since the other branch already panics eagerly (via `reserve()`) we do the same here.
47142 /// when full, nor when [`reserve`] is called. The current strategy is basic
47177 /// [`reserve`]: Vec::reserve
47569 /// in the given `Vec<T>`. The collection may reserve more space to avoid
47570 /// frequent reallocations. After calling `reserve`, capacity will be
47582 /// vec.reserve(10);
47587 pub fn reserve(&mut self, additional: usize) {
47588 self.buf.reserve(self.len, additional);
47598 /// minimal. Prefer `reserve` if future insertions are expected.
47617 /// Tries to reserve capacity for at least `additional` more elements to be inserted
47618 /// in the given `Vec<T>`. The collection may reserve more space to avoid
47637 /// // Pre-reserve the memory, exiting if we can't
47655 /// Tries to reserve the minimum capacity for exactly `additional`
47663 /// minimal. Prefer `reserve` if future insertions are expected.
47679 /// // Pre-reserve the memory, exiting if we can't
48125 self.reserve(1);
48444 self.reserve(1);
48504 self.reserve(count);
48822 /// v.reserve(10);
48952 self.reserve(range.len());
49001 self.reserve(n);
49111 // - `.reserve(count)` guarantees that `spare.len() >= count` so spare
49292 self.reserve(additional);
49311 self.reserve(lower.saturating_add(1));
49443 self.reserve(additional);
50077 vec.buf.reserve(len, additional);
51910 v.reserve(50, 150); // (causes a realloc, thus using 50 + 150 = 200 units of fuel)
51918 // First, `reserve` allocates like `reserve_exact`.
51919 v.reserve(0, 9);
51925 v.reserve(0, 7);
51927 // 97 is more than double of 7, so `reserve` should work
51929 v.reserve(7, 90);
51935 v.reserve(0, 12);
51937 v.reserve(12, 3);
51938 // 3 is less than half of 12, so `reserve` must grow