Files

79 lines
1.6 KiB
Python
Raw Permalink Normal View History

2020-12-09 12:43:56 -08:00
load("//tools:defs.bzl", "go_library", "go_test")
2021-06-01 17:45:10 -07:00
load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance")
2020-12-09 12:43:56 -08:00
package(
default_applicable_licenses = ["//:license"],
2020-12-09 12:43:56 -08:00
default_visibility = ["//visibility:private"],
licenses = ["notice"],
)
2021-06-01 17:45:10 -07:00
go_template(
name = "generic_atomicptrmap",
srcs = ["generic_atomicptrmap_unsafe.go"],
opt_consts = [
"ShardOrder",
],
opt_types = [
"Hasher",
],
types = [
"Key",
"Value",
],
2021-09-09 16:14:56 -07:00
visibility = ["//:sandbox"],
2021-06-01 17:45:10 -07:00
deps = [
"//pkg/gohacks",
"//pkg/sync",
],
)
2020-12-09 12:43:56 -08:00
go_template_instance(
name = "test_atomicptrmap",
out = "test_atomicptrmap_unsafe.go",
package = "atomicptrmap",
prefix = "test",
2021-06-01 17:45:10 -07:00
template = ":generic_atomicptrmap",
2020-12-09 12:43:56 -08:00
types = {
"Key": "int64",
"Value": "testValue",
},
)
go_template_instance(
name = "test_atomicptrmap_sharded",
out = "test_atomicptrmap_sharded_unsafe.go",
consts = {
"ShardOrder": "4",
},
package = "atomicptrmap",
prefix = "test",
suffix = "Sharded",
2021-06-01 17:45:10 -07:00
template = ":generic_atomicptrmap",
2020-12-09 12:43:56 -08:00
types = {
"Key": "int64",
"Value": "testValue",
},
)
go_library(
name = "atomicptrmap",
testonly = 1,
srcs = [
"atomicptrmap.go",
"test_atomicptrmap_sharded_unsafe.go",
"test_atomicptrmap_unsafe.go",
],
deps = [
"//pkg/gohacks",
"//pkg/sync",
],
)
go_test(
name = "atomicptrmap_test",
size = "small",
srcs = ["atomicptrmap_test.go"],
library = ":atomicptrmap",
deps = ["//pkg/sync"],
)