(&mut self)
| 110 | |
| 111 | impl PooledBuffer { |
| 112 | fn reset(&mut self) { |
| 113 | self.buffer.clear(); |
| 114 | self.last_used = Instant::now(); |
| 115 | self.allocation_count += 1; |
| 116 | } |
| 117 | |
| 118 | fn should_discard(&self, max_capacity: usize, cleanup_age: Duration) -> bool { |
| 119 | // Discard if buffer has grown too large or is too old |