• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22cc_library(
23    name = "base",
24    hdrs = ["public/pw_allocator/bucket/base.h"],
25    strip_include_prefix = "public",
26    visibility = ["//visibility:private"],
27    deps = [
28        "//pw_allocator",
29        "//pw_allocator:hardening",
30        "//pw_allocator/block:poisonable",
31        "//pw_assert:assert",
32    ],
33)
34
35cc_library(
36    name = "fast_sorted",
37    hdrs = ["public/pw_allocator/bucket/fast_sorted.h"],
38    strip_include_prefix = "public",
39    deps = [
40        ":base",
41        "//pw_containers:intrusive_multimap",
42    ],
43)
44
45cc_library(
46    name = "sequenced",
47    hdrs = ["public/pw_allocator/bucket/sequenced.h"],
48    strip_include_prefix = "public",
49    deps = [
50        ":base",
51        "//pw_containers:intrusive_list",
52    ],
53)
54
55cc_library(
56    name = "sorted",
57    hdrs = ["public/pw_allocator/bucket/sorted.h"],
58    strip_include_prefix = "public",
59    deps = [
60        ":base",
61        "//pw_containers:intrusive_forward_list",
62    ],
63)
64
65cc_library(
66    name = "unordered",
67    hdrs = ["public/pw_allocator/bucket/unordered.h"],
68    strip_include_prefix = "public",
69    deps = [
70        ":base",
71        "//pw_containers:intrusive_forward_list",
72    ],
73)
74
75cc_library(
76    name = "testing",
77    testonly = True,
78    hdrs = ["public/pw_allocator/bucket/testing.h"],
79    strip_include_prefix = "public",
80    tags = ["noclangtidy"],
81    deps = [
82        "//pw_allocator:buffer",
83        "//pw_allocator:bump_allocator",
84    ],
85)
86
87pw_cc_test(
88    name = "fast_sorted_test",
89    srcs = ["fast_sorted_test.cc"],
90    deps = [
91        ":fast_sorted",
92        ":testing",
93        "//pw_allocator/block:detailed_block",
94    ],
95)
96
97pw_cc_test(
98    name = "sequenced_test",
99    srcs = ["sequenced_test.cc"],
100    deps = [
101        ":sequenced",
102        ":testing",
103        "//pw_allocator/block:detailed_block",
104    ],
105)
106
107pw_cc_test(
108    name = "sorted_test",
109    srcs = ["sorted_test.cc"],
110    deps = [
111        ":sorted",
112        ":testing",
113        "//pw_allocator/block:detailed_block",
114    ],
115)
116
117pw_cc_test(
118    name = "unordered_test",
119    srcs = ["unordered_test.cc"],
120    deps = [
121        ":testing",
122        ":unordered",
123        "//pw_allocator/block:detailed_block",
124    ],
125)
126
127filegroup(
128    name = "doxygen",
129    srcs = [
130        "public/pw_allocator/bucket/base.h",
131        "public/pw_allocator/bucket/fast_sorted.h",
132        "public/pw_allocator/bucket/sequenced.h",
133        "public/pw_allocator/bucket/sorted.h",
134        "public/pw_allocator/bucket/unordered.h",
135    ],
136)
137