Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1159)

Side by Side Diff: src/pkg/io/ioutil/blackhole.go

Issue 44060044: code review 44060044: io/ioutil: use sync.Pool in Discard (Closed)
Patch Set: diff -r 7b554415f8bd https://go.googlecode.com/hg/ Created 10 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/io/ioutil/ioutil.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package ioutil
6
7 var blackHoleBuf = make(chan []byte, 1)
8
9 func blackHole() []byte {
10 select {
11 case b := <-blackHoleBuf:
12 return b
13 default:
14 }
15 return make([]byte, 8192)
16 }
17
18 func blackHolePut(p []byte) {
19 select {
20 case blackHoleBuf <- p:
21 default:
22 }
23 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/io/ioutil/ioutil.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b