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

Method try_resize

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

Try to set the size of this reservation to `capacity`

(&self, capacity: usize)

Source from the content-addressed store, hash-verified

448
449 /// Try to set the size of this reservation to `capacity`
450 pub fn try_resize(&self, capacity: usize) -> Result<()> {
451 let size = self.size.load(atomic::Ordering::Relaxed);
452 match capacity.cmp(&size) {
453 Ordering::Greater => self.try_grow(capacity - size)?,
454 Ordering::Less => {
455 self.try_shrink(size - capacity)?;
456 }
457 _ => {}
458 };
459 Ok(())
460 }
461
462 /// Increase the size of this reservation by `capacity` bytes
463 pub fn grow(&self, capacity: usize) {

Callers 13

deduplicateMethod · 0.80
convert_batchMethod · 0.80
in_mem_sort_streamMethod · 0.80
sort_batch_streamMethod · 0.80
insert_batchMethod · 0.80
column_serializer_taskFunction · 0.80

Calls 4

try_shrinkMethod · 0.80
loadMethod · 0.45
cmpMethod · 0.45
try_growMethod · 0.45

Tested by 1