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

Method reserve

arrow-buffer/src/buffer/mutable.rs:281–291  ·  view source on GitHub ↗
(&mut self, additional: usize)

Source from the content-addressed store, hash-verified

279 // exits.
280 #[inline(always)]
281 pub fn reserve(&mut self, additional: usize) {
282 let required_cap = self
283 .len
284 .checked_add(additional)
285 .expect("buffer length overflow");
286 if required_cap > self.layout.size() {
287 let new_capacity = bit_util::round_upto_multiple_of_64(required_cap);
288 let new_capacity = std::cmp::max(new_capacity, self.layout.size() * 2);
289 self.reallocate(new_capacity)
290 }
291 }
292
293 /// Adding to this mutable buffer `slice_to_repeat` repeated `repeat_count` times.
294 ///

Callers 11

repeat_slice_n_timesMethod · 0.45
resizeMethod · 0.45
extend_from_sliceMethod · 0.45
pushMethod · 0.45
claimMethod · 0.45
extend_from_iterMethod · 0.45
from_iterMethod · 0.45
test_mutable_reserveFunction · 0.45
test_mutable_equalFunction · 0.45

Calls 5

maxFunction · 0.85
reallocateMethod · 0.80
checked_addMethod · 0.45
sizeMethod · 0.45

Tested by 3

test_mutable_reserveFunction · 0.36
test_mutable_equalFunction · 0.36