go/src/io
Joe Tsai 56076c3080 io: reduce allocations in Pipe constructor
Rather than having PipeWriter and PipeReader a wrapper type on pipe,
make them have the same underlying memory representation and
rely instead of simply casting the same *pipe pointer
as either a *PipeReader or *PipeWriter to control the set of methods.

This reduces the number of allocations by 2,
going from a total of 6 down to 4 allocations.

Change-Id: I09207a00c4b7afb44c7773d752c5628a07e24fda
Reviewed-on: https://go-review.googlesource.com/c/go/+/473535
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-17 16:25:48 +00:00
..
fs all: add String for fs.{FileInfo,DirEntry} implementations 2023-05-04 16:27:35 +00:00
ioutil all: add wasip1 support 2023-04-11 20:56:32 +00:00
example_test.go io: use strings.Builder 2022-09-06 15:49:32 +00:00
export_test.go io: add OffsetWriter, NewOffsetWriter 2022-08-19 17:03:55 +00:00
io.go all: add a few more godoc links 2023-08-07 06:58:18 +00:00
io_test.go io: prevent seeking to position prior to offsetwrite.base 2023-05-20 00:46:20 +00:00
multi.go
multi_test.go io: use strings.Builder 2022-09-06 15:49:32 +00:00
pipe.go io: reduce allocations in Pipe constructor 2023-08-17 16:25:48 +00:00
pipe_test.go