MCPcopy Create free account
hub / github.com/apache/arrow-rs / reserve

Method reserve

arrow-buffer/src/builder/boolean.rs:161–168  ·  view source on GitHub ↗
(&mut self, additional: usize)

Source from the content-addressed store, hash-verified

159 /// Capacity will be `>= self.len() + additional`.
160 #[inline]
161 pub fn reserve(&mut self, additional: usize) {
162 let capacity = self.len + additional;
163 if capacity > self.capacity() {
164 // convert differential to bytes
165 let additional = bit_util::ceil(capacity, 8) - self.buffer.len();
166 self.buffer.reserve(additional);
167 }
168 }
169
170 /// Resizes the buffer, either truncating its contents (with no change in capacity), or
171 /// growing it (potentially reallocating it) and writing `false` in the newly available bits.

Callers

nothing calls this directly

Calls 3

ceilFunction · 0.50
capacityMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected