github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sync/atomicptrmap/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance") 3 4 package( 5 default_visibility = ["//visibility:private"], 6 licenses = ["notice"], 7 ) 8 9 go_template( 10 name = "generic_atomicptrmap", 11 srcs = ["generic_atomicptrmap_unsafe.go"], 12 opt_consts = [ 13 "ShardOrder", 14 ], 15 opt_types = [ 16 "Hasher", 17 ], 18 types = [ 19 "Key", 20 "Value", 21 ], 22 deps = [ 23 "//pkg/gohacks", 24 "//pkg/sync", 25 ], 26 ) 27 28 go_template_instance( 29 name = "test_atomicptrmap", 30 out = "test_atomicptrmap_unsafe.go", 31 package = "atomicptrmap", 32 prefix = "test", 33 template = ":generic_atomicptrmap", 34 types = { 35 "Key": "int64", 36 "Value": "testValue", 37 }, 38 ) 39 40 go_template_instance( 41 name = "test_atomicptrmap_sharded", 42 out = "test_atomicptrmap_sharded_unsafe.go", 43 consts = { 44 "ShardOrder": "4", 45 }, 46 package = "atomicptrmap", 47 prefix = "test", 48 suffix = "Sharded", 49 template = ":generic_atomicptrmap", 50 types = { 51 "Key": "int64", 52 "Value": "testValue", 53 }, 54 ) 55 56 go_library( 57 name = "atomicptrmap", 58 testonly = 1, 59 srcs = [ 60 "atomicptrmap.go", 61 "test_atomicptrmap_sharded_unsafe.go", 62 "test_atomicptrmap_unsafe.go", 63 ], 64 deps = [ 65 "//pkg/gohacks", 66 "//pkg/sync", 67 ], 68 ) 69 70 go_test( 71 name = "atomicptrmap_test", 72 size = "small", 73 srcs = ["atomicptrmap_test.go"], 74 library = ":atomicptrmap", 75 deps = ["//pkg/sync"], 76 )