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