File: pool_go12.go

package info (click to toggle)
golang-gopkg-alexcesaro-quotedprintable.v3 0.0~git20150716.0.2caba25-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 116 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 306 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// +build !go1.3

package quotedprintable

import "bytes"

var ch = make(chan *bytes.Buffer, 32)

func getBuffer() *bytes.Buffer {
	select {
	case buf := <-ch:
		return buf
	default:
	}
	return new(bytes.Buffer)
}

func putBuffer(buf *bytes.Buffer) {
	buf.Reset()
	select {
	case ch <- buf:
	default:
	}
}