(&mut self, value: T)
| 378 | #[inline(never)] |
| 379 | #[cold] |
| 380 | fn alloc_slow(&mut self, value: T) -> Result<Id, OutOfMemory> { |
| 381 | // Reserve additional capacity, since we didn't have space for the |
| 382 | // allocation. |
| 383 | self.double_capacity()?; |
| 384 | // After which the allocation will succeed. |
| 385 | let id = self.try_alloc(value).ok().unwrap(); |
| 386 | Ok(id) |
| 387 | } |
| 388 | |
| 389 | /// Get a shared borrow of the value associated with `id`. |
| 390 | /// |