github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/state/BUILD (about)

     1  load("//tools:defs.bzl", "go_library")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(licenses = ["notice"])
     5  
     6  go_template_instance(
     7      name = "deferred_list",
     8      out = "deferred_list.go",
     9      package = "state",
    10      prefix = "deferred",
    11      template = "//pkg/ilist:generic_list",
    12      types = {
    13          "Element": "*objectEncodeState",
    14          "ElementMapper": "deferredMapper",
    15          "Linker": "*deferredEntry",
    16      },
    17  )
    18  
    19  go_template_instance(
    20      name = "complete_list",
    21      out = "complete_list.go",
    22      package = "state",
    23      prefix = "complete",
    24      template = "//pkg/ilist:generic_list",
    25      types = {
    26          "Element": "*objectDecodeState",
    27          "Linker": "*objectDecodeState",
    28      },
    29  )
    30  
    31  go_template_instance(
    32      name = "addr_range",
    33      out = "addr_range.go",
    34      package = "state",
    35      prefix = "addr",
    36      template = "//pkg/segment:generic_range",
    37      types = {
    38          "T": "uintptr",
    39      },
    40  )
    41  
    42  go_template_instance(
    43      name = "addr_set",
    44      out = "addr_set.go",
    45      consts = {
    46          "minDegree": "10",
    47      },
    48      imports = {
    49          "reflect": "reflect",
    50      },
    51      package = "state",
    52      prefix = "addr",
    53      template = "//pkg/segment:generic_set",
    54      types = {
    55          "Key": "uintptr",
    56          "Range": "addrRange",
    57          "Value": "*objectEncodeState",
    58          "Functions": "addrSetFunctions",
    59      },
    60  )
    61  
    62  go_library(
    63      name = "state",
    64      srcs = [
    65          "addr_range.go",
    66          "addr_set.go",
    67          "complete_list.go",
    68          "decode.go",
    69          "decode_unsafe.go",
    70          "deferred_list.go",
    71          "encode.go",
    72          "encode_unsafe.go",
    73          "state.go",
    74          "state_norace.go",
    75          "state_race.go",
    76          "stats.go",
    77          "types.go",
    78      ],
    79      marshal = False,
    80      stateify = False,
    81      visibility = ["//:sandbox"],
    82      deps = [
    83          "//pkg/log",
    84          "//pkg/state/wire",
    85      ],
    86  )