2018-04-27 17:37:02 +00:00
|
|
|
package(licenses = ["notice"]) # Apache 2.0
|
|
|
|
|
2018-09-04 16:18:00 +00:00
|
|
|
load("//tools/go_generics:defs.bzl", "go_template_instance")
|
2018-07-27 17:16:27 +00:00
|
|
|
load("//tools/go_stateify:defs.bzl", "go_library", "go_test")
|
2018-04-27 17:37:02 +00:00
|
|
|
|
2018-09-04 16:18:00 +00:00
|
|
|
go_template_instance(
|
|
|
|
name = "weak_ref_list",
|
|
|
|
out = "weak_ref_list.go",
|
|
|
|
package = "refs",
|
|
|
|
prefix = "weakRef",
|
|
|
|
template = "//pkg/ilist:generic_list",
|
|
|
|
types = {
|
|
|
|
"Element": "*WeakRef",
|
|
|
|
"Linker": "*WeakRef",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
2018-04-27 17:37:02 +00:00
|
|
|
go_library(
|
|
|
|
name = "refs",
|
|
|
|
srcs = [
|
|
|
|
"refcounter.go",
|
|
|
|
"refcounter_state.go",
|
2018-09-04 16:18:00 +00:00
|
|
|
"weak_ref_list.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
],
|
|
|
|
importpath = "gvisor.googlesource.com/gvisor/pkg/refs",
|
|
|
|
visibility = ["//:sandbox"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_test(
|
|
|
|
name = "refs_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["refcounter_test.go"],
|
|
|
|
embed = [":refs"],
|
|
|
|
)
|