Frees all bytes from this reservation back to the underlying pool, returning the number of bytes freed.
(&self)
| 389 | /// Frees all bytes from this reservation back to the underlying |
| 390 | /// pool, returning the number of bytes freed. |
| 391 | pub fn free(&self) -> usize { |
| 392 | let size = self.size.swap(0, atomic::Ordering::Relaxed); |
| 393 | if size != 0 { |
| 394 | self.registration.pool.shrink(self, size); |
| 395 | } |
| 396 | size |
| 397 | } |
| 398 | |
| 399 | /// Frees `capacity` bytes from this reservation |
| 400 | /// |