Returns a new empty [`MemoryReservation`] with the same [`MemoryConsumer`]
(&self)
| 500 | |
| 501 | /// Returns a new empty [`MemoryReservation`] with the same [`MemoryConsumer`] |
| 502 | pub fn new_empty(&self) -> Self { |
| 503 | Self { |
| 504 | size: atomic::AtomicUsize::new(0), |
| 505 | registration: Arc::clone(&self.registration), |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | /// Splits off all the bytes from this [`MemoryReservation`] into |
| 510 | /// a new [`MemoryReservation`] with the same [`MemoryConsumer`] |