pools.go 305 B

123456789101112131415161718192021
  1. package internal
  2. import (
  3. "sync"
  4. )
  5. var (
  6. // ByteInputAdapterPool shared pool
  7. ByteInputAdapterPool = sync.Pool{
  8. New: func() interface{} {
  9. return &ByteInputAdapter{}
  10. },
  11. }
  12. // ByteBufferPool shared pool
  13. ByteBufferPool = sync.Pool{
  14. New: func() interface{} {
  15. return &ByteBuffer{}
  16. },
  17. }
  18. )