mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
These interfaces only existed to add ReadByte() and WriteByte() methods. There
were only 4 implementors of these methods: compressio.{Simple}{Reader/Writer}.
And there were only 2 users of this.
Using io.{Reader/Writer} is more extendible. For instance, it allows using
*os.File with the `wire` package without any wrappers.
Updated the 2 users to implement their own {read/write}Byte(). To avoid heap
allocation of the [1]byte storage during call to io.Reader.Read or
io.Writer.Write due to interface call, used sync.Pool. Earlier, calls to
compressio.Simple{Reader/Writer}'s implementation of {Read/Write}Byte would
cause a heap allocation.
PiperOrigin-RevId: 625167495
44 lines
812 B
Python
44 lines
812 B
Python
load("//tools:defs.bzl", "go_library", "go_test")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_library(
|
|
name = "tests",
|
|
srcs = [
|
|
"array.go",
|
|
"bench.go",
|
|
"integer.go",
|
|
"load.go",
|
|
"map.go",
|
|
"register.go",
|
|
"struct.go",
|
|
"tests.go",
|
|
],
|
|
deps = [
|
|
"//pkg/state",
|
|
"//pkg/state/pretty",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "tests_test",
|
|
size = "small",
|
|
srcs = [
|
|
"array_test.go",
|
|
"bench_test.go",
|
|
"bool_test.go",
|
|
"float_test.go",
|
|
"integer_test.go",
|
|
"load_test.go",
|
|
"map_test.go",
|
|
"register_test.go",
|
|
"string_test.go",
|
|
"struct_test.go",
|
|
],
|
|
library = ":tests",
|
|
deps = ["//pkg/state"],
|
|
)
|