MCPcopy Create free account
hub / github.com/apache/datafusion / shrink

Method shrink

datafusion/execution/src/memory_pool/mod.rs:404–415  ·  view source on GitHub ↗

Frees `capacity` bytes from this reservation # Panics Panics if `capacity` exceeds [`Self::size`]

(&self, capacity: usize)

Source from the content-addressed store, hash-verified

402 ///
403 /// Panics if `capacity` exceeds [`Self::size`]
404 pub fn shrink(&self, capacity: usize) {
405 self.size
406 .fetch_update(
407 atomic::Ordering::Relaxed,
408 atomic::Ordering::Relaxed,
409 |prev| prev.checked_sub(capacity),
410 )
411 .unwrap_or_else(|prev| {
412 panic!("Cannot free the capacity {capacity} out of allocated size {prev}")
413 });
414 self.registration.pool.shrink(self, capacity);
415 }
416
417 /// Tries to free `capacity` bytes from this reservation
418 /// if `capacity` does not exceed [`Self::size`].

Callers 11

spill_to_diskMethod · 0.45
poll_nextMethod · 0.45
poll_nextMethod · 0.45
spillMethod · 0.45
finish_record_batchMethod · 0.45
sendMethod · 0.45
poll_next_innerMethod · 0.45
free_reservationMethod · 0.45
freeMethod · 0.45
try_shrinkMethod · 0.45
resizeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected