Get gets a T from the pool, or creates a new one if the pool is empty.
()
| 49 | |
| 50 | // Get gets a T from the pool, or creates a new one if the pool is empty. |
| 51 | func (p *Pool[T]) Get() T { |
| 52 | return p.pool.Get().(T) |
| 53 | } |
| 54 | |
| 55 | // Put returns x into the pool. |
| 56 | func (p *Pool[T]) Put(x T) { |
no outgoing calls