(&mut self, size: usize)
| 83 | /// (LIFO order). |
| 84 | #[inline(always)] |
| 85 | pub fn push(&mut self, size: usize) -> *mut u8 { |
| 86 | let aligned_size = (size + ALIGN - 1) & !(ALIGN - 1); |
| 87 | unsafe { |
| 88 | if self.top.add(aligned_size) <= self.limit { |
| 89 | let ptr = self.top; |
| 90 | self.top = self.top.add(aligned_size); |
| 91 | ptr |
| 92 | } else { |
| 93 | self.push_slow(aligned_size) |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /// Slow path: allocate a new chunk and push from it. |
| 99 | #[cold] |