本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 line
335B

  1. // +build go1.3
  2. package quotedprintable
  3. import (
  4. "bytes"
  5. "sync"
  6. )
  7. var bufPool = sync.Pool{
  8. New: func() interface{} {
  9. return new(bytes.Buffer)
  10. },
  11. }
  12. func getBuffer() *bytes.Buffer {
  13. return bufPool.Get().(*bytes.Buffer)
  14. }
  15. func putBuffer(buf *bytes.Buffer) {
  16. if buf.Len() > 1024 {
  17. return
  18. }
  19. buf.Reset()
  20. bufPool.Put(buf)
  21. }
上海开阖软件有限公司 沪ICP备12045867号-1