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.

24 lines
306 B

  1. // +build !go1.3
  2. package quotedprintable
  3. import "bytes"
  4. var ch = make(chan *bytes.Buffer, 32)
  5. func getBuffer() *bytes.Buffer {
  6. select {
  7. case buf := <-ch:
  8. return buf
  9. default:
  10. }
  11. return new(bytes.Buffer)
  12. }
  13. func putBuffer(buf *bytes.Buffer) {
  14. buf.Reset()
  15. select {
  16. case ch <- buf:
  17. default:
  18. }
  19. }