pool.go 176 B

123456789101112
  1. package buf
  2. func Get(size int) []byte {
  3. if size == 0 {
  4. return nil
  5. }
  6. return DefaultAllocator.Get(size)
  7. }
  8. func Put(buf []byte) error {
  9. return DefaultAllocator.Put(buf)
  10. }