1
0
mirror of https://github.com/golang/go synced 2024-11-23 03:50:03 -07:00

internal/poll: fix some grammar errors

Change-Id: I25a6424bce9d372fa46e8bdd856095845d3397bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/300889
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Andy Pan 2021-03-11 22:34:45 +08:00 committed by Emmanuel Odeke
parent a607408403
commit 71330963c0

View File

@ -160,9 +160,9 @@ type splicePipe struct {
data int
}
// splicePipePool caches pipes to avoid high frequency construction and destruction of pipe buffers.
// The garbage collector will free all pipes in the sync.Pool in periodically, thus we need to set up
// a finalizer for each pipe to close the its file descriptors before the actual GC.
// splicePipePool caches pipes to avoid high-frequency construction and destruction of pipe buffers.
// The garbage collector will free all pipes in the sync.Pool periodically, thus we need to set up
// a finalizer for each pipe to close its file descriptors before the actual GC.
var splicePipePool = sync.Pool{New: newPoolPipe}
func newPoolPipe() interface{} {
@ -175,10 +175,10 @@ func newPoolPipe() interface{} {
return p
}
// getPipe tries to acquire a pipe buffer from the pool or create a new one with newPipe() if it gets nil from cache.
// getPipe tries to acquire a pipe buffer from the pool or create a new one with newPipe() if it gets nil from the cache.
//
// Note that it may fail to create a new pipe buffer by newPipe(), in which case getPipe() will return a generic error
// and system call name splice in string as the indication.
// and system call name splice in a string as the indication.
func getPipe() (*splicePipe, string, error) {
v := splicePipePool.Get()
if v == nil {