rename bufferv2 to buffer

The old buffer has been dead for a while. We use type aliases so we can switch
package names in smaller CLs.

PiperOrigin-RevId: 537125110
This commit is contained in:
Kevin Krakauer
2023-06-01 14:16:05 -07:00
committed by gVisor bot
parent aa8abdfa92
commit c006f01e0e
12 changed files with 775 additions and 648 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ _templates:
./pkg/tcpip/transport/icmp
./pkg/tcpip/transport/tcp
./pkg/tcpip/transport/udp
./pkg/bufferv2
./pkg/buffer
./pkg/waiter
env:
# Force a clean checkout every time to avoid reuse of files between runs.
+69
View File
@@ -0,0 +1,69 @@
load("//tools:defs.bzl", "go_library", "go_test")
load("//tools/go_generics:defs.bzl", "go_template_instance")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_template_instance(
name = "chunk_refs",
out = "chunk_refs.go",
package = "buffer",
prefix = "chunk",
template = "//pkg/refs:refs_template",
types = {
"T": "chunk",
},
)
go_template_instance(
name = "view_list",
out = "view_list.go",
package = "buffer",
prefix = "view",
template = "//pkg/ilist:generic_list",
types = {
"Element": "*View",
"Linker": "*View",
},
)
go_library(
name = "buffer",
srcs = [
"buffer.go",
"buffer_state.go",
"chunk.go",
"chunk_refs.go",
"view.go",
"view_list.go",
"view_unsafe.go",
],
visibility = ["//visibility:public"],
deps = [
"//pkg/atomicbitops",
"//pkg/bits",
"//pkg/context",
"//pkg/ilist",
"//pkg/log",
"//pkg/pool",
"//pkg/refs",
"//pkg/sync",
"//pkg/tcpip/checksum",
],
)
go_test(
name = "buffer_test",
srcs = [
"buffer_test.go",
"view_test.go",
],
library = ":buffer",
deps = [
"//pkg/state",
"//pkg/tcpip/checksum",
"@com_github_google_go_cmp//cmp:go_default_library",
],
)
File diff suppressed because it is too large Load Diff
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
// saveData is invoked by stateify.
func (b *Buffer) saveData() []byte {
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
import (
"bytes"
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
import (
"fmt"
+1 -1
View File
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
import (
"fmt"
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
import (
"bytes"
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package bufferv2
package buffer
import (
"reflect"
+2 -54
View File
@@ -1,69 +1,17 @@
load("//tools:defs.bzl", "go_library", "go_test")
load("//tools/go_generics:defs.bzl", "go_template_instance")
load("//tools:defs.bzl", "go_library")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_template_instance(
name = "chunk_refs",
out = "chunk_refs.go",
package = "bufferv2",
prefix = "chunk",
template = "//pkg/refs:refs_template",
types = {
"T": "chunk",
},
)
go_template_instance(
name = "view_list",
out = "view_list.go",
package = "bufferv2",
prefix = "view",
template = "//pkg/ilist:generic_list",
types = {
"Element": "*View",
"Linker": "*View",
},
)
go_library(
name = "bufferv2",
srcs = [
"buffer.go",
"buffer_state.go",
"chunk.go",
"chunk_refs.go",
"view.go",
"view_list.go",
"view_unsafe.go",
],
visibility = ["//visibility:public"],
deps = [
"//pkg/atomicbitops",
"//pkg/bits",
"//pkg/context",
"//pkg/ilist",
"//pkg/log",
"//pkg/pool",
"//pkg/refs",
"//pkg/sync",
"//pkg/tcpip/checksum",
],
)
go_test(
name = "bufferv2_test",
srcs = [
"buffer_test.go",
"view_test.go",
],
library = ":bufferv2",
deps = [
"//pkg/state",
"//pkg/tcpip/checksum",
"@com_github_google_go_cmp//cmp:go_default_library",
"//pkg/buffer",
],
)
+63 -587
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -53,6 +53,7 @@ deps_test(
"//pkg/atomicbitops",
"//pkg/bits",
"//pkg/context",
"//pkg/buffer",
"//pkg/bufferv2",
"//pkg/cpuid",
"//pkg/gohacks",