sync.Pool.New (field)
61 uses
sync (current package)
pool.go#L63: New func() any
pool.go#L154: if x == nil && p.New != nil {
pool.go#L155: x = p.New()
crypto/internal/fips140/drbg
rand.go#L25: New: func() any {
crypto/tls
conn.go#L973: New: func() any {
encoding/json
scanner.go#L90: New: func() any {
fmt
print.go#L147: New: func() any { return new(pp) },
scan.go#L379: New: func() any { return new(ss) },
github.com/jackc/pgx/v5/internal/iobufpool
iobufpool.go#L20: New: func() any {
go.pact.im/x/zapjournal
pool.go#L15: New: func() any {
go.uber.org/multierr
error.go#L178: New: func() interface{} {
go.uber.org/zap/internal/pool
pool.go#L43: New: func() any {
go/printer
printer.go#L1324: New: func() any {
golang.org/x/net/http2
databuffer.go#L24: {New: func() interface{} { return new([1 << 10]byte) }},
databuffer.go#L25: {New: func() interface{} { return new([2 << 10]byte) }},
databuffer.go#L26: {New: func() interface{} { return new([4 << 10]byte) }},
databuffer.go#L27: {New: func() interface{} { return new([8 << 10]byte) }},
databuffer.go#L28: {New: func() interface{} { return new([16 << 10]byte) }},
frame.go#L230: New: func() interface{} {
gotrack.go#L82: New: func() interface{} {
http2.go#L283: New: func() interface{} {
http2.go#L379: var sorterPool = sync.Pool{New: func() interface{} { return new(sorter) }}
server.go#L78: New: func() interface{} {
server.go#L137: New: func() any { return make(chan error, 1) },
server.go#L164: errChanPool: sync.Pool{New: func() any { return make(chan error, 1) }},
server.go#L1006: New: func() interface{} { return new(writeData) },
transport.go#L2767: var gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }}
golang.org/x/net/http2/hpack
huffman.go#L15: New: func() interface{} { return new(bytes.Buffer) },
google.golang.org/grpc
rpc_util.go#L84: New: func() any {
google.golang.org/grpc/internal/transport
controlbuf.go#L42: New: func() any {
google.golang.org/grpc/mem
buffers.go#L68: bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }}
google.golang.org/protobuf/internal/filedesc
desc_init.go#L553: New: func() any { return new(strs.Builder) },
google.golang.org/protobuf/internal/order
range.go#L21: New: func() any { return new([]messageField) },
range.go#L72: New: func() any { return new([]mapEntry) },
internal/poll
splice_linux.go#L187: var splicePipePool = sync.Pool{New: newPoolPipe}
io
io.go#L656: New: func() any {
log
log.go#L166: var bufferPool = sync.Pool{New: func() any { return new([]byte) }}
log/slog
handler.go#L391: var groupPool = sync.Pool{New: func() any {
json_handler.go#L147: New: func() any {
log/slog/internal/buffer
buffer.go#L18: New: func() any {
net/http
h2_bundle.go#L1207: {New: func() interface{} { return new([1 << 10]byte) }},
h2_bundle.go#L1208: {New: func() interface{} { return new([2 << 10]byte) }},
h2_bundle.go#L1209: {New: func() interface{} { return new([4 << 10]byte) }},
h2_bundle.go#L1210: {New: func() interface{} { return new([8 << 10]byte) }},
h2_bundle.go#L1211: {New: func() interface{} { return new([16 << 10]byte) }},
h2_bundle.go#L1785: New: func() interface{} {
h2_bundle.go#L3382: New: func() interface{} {
h2_bundle.go#L3727: New: func() interface{} {
h2_bundle.go#L3825: var http2sorterPool = sync.Pool{New: func() interface{} { return new(http2sorter) }}
h2_bundle.go#L4058: New: func() interface{} {
h2_bundle.go#L4204: New: func() any { return make(chan error, 1) },
h2_bundle.go#L4236: errChanPool: sync.Pool{New: func() any { return make(chan error, 1) }},
h2_bundle.go#L5144: New: func() interface{} { return new(http2writeData) },
h2_bundle.go#L10448: var http2gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }}
header.go#L161: New: func() any { return new(headerSorter) },
server.go#L834: var copyBufPool = sync.Pool{New: func() any { return new([copyBufPoolSize]byte) }}
transport.go#L3128: var gzipPool = sync.Pool{New: func() any { return new(gzip.Reader) }}
os
dir_unix.go#L33: New: func() any {
reflect
type.go#L2871: framePool = &sync.Pool{New: func() any {
syscall
netlink_linux.go#L53: var pageBufPool = &sync.Pool{New: func() any {
vendor/golang.org/x/net/http2/hpack
huffman.go#L15: New: func() interface{} { return new(bytes.Buffer) },