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

Method resize_reservation

arrow-buffer/src/bytes.rs:125–134  ·  view source on GitHub ↗
(&self, new_size: usize)

Source from the content-addressed store, hash-verified

123 /// This is a no-op if this buffer doesn't have a reservation.
124 #[cfg(feature = "pool")]
125 fn resize_reservation(&self, new_size: usize) {
126 let mut guard = self.reservation.lock().unwrap();
127 if let Some(mut reservation) = guard.take() {
128 // Resize the reservation
129 reservation.resize(new_size);
130
131 // Put it back
132 *guard = Some(reservation);
133 }
134 }
135
136 /// Try to reallocate the underlying memory region to a new size (smaller or larger).
137 ///

Callers 1

try_reallocMethod · 0.80

Calls 2

takeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected