Registers this [`MemoryConsumer`] with the provided [`MemoryPool`] returning a [`MemoryReservation`] that can be used to grow or shrink the memory reservation
(self, pool: &Arc<dyn MemoryPool>)
| 337 | /// Registers this [`MemoryConsumer`] with the provided [`MemoryPool`] returning |
| 338 | /// a [`MemoryReservation`] that can be used to grow or shrink the memory reservation |
| 339 | pub fn register(self, pool: &Arc<dyn MemoryPool>) -> MemoryReservation { |
| 340 | pool.register(&self); |
| 341 | MemoryReservation { |
| 342 | registration: Arc::new(SharedRegistration { |
| 343 | pool: Arc::clone(pool), |
| 344 | consumer: self, |
| 345 | }), |
| 346 | size: atomic::AtomicUsize::new(0), |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | /// A registration of a [`MemoryConsumer`] with a [`MemoryPool`]. |