blob: 71f255ccc33d4a0121adc1f3a1f6197759f4fefb [file] [log] [blame]
Jamie Garside558e1442020-03-27 17:05:55 +00001# Copyright 2020 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(
16 "//pw_build:pigweed.bzl",
17 "pw_cc_library",
18 "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
Rob Mohr5fc25412021-06-23 09:35:23 -070023licenses(["notice"])
Jamie Garside558e1442020-03-27 17:05:55 +000024
25pw_cc_library(
26 name = "block",
27 srcs = [
28 "block.cc",
29 ],
30 hdrs = [
31 "public/pw_allocator/block.h",
32 ],
33 includes = ["public"],
34 deps = [
Nathaniel Broughc2d57812021-04-18 22:52:00 +080035 "//pw_assert",
Jamie Garside558e1442020-03-27 17:05:55 +000036 "//pw_span",
37 "//pw_status",
38 ],
39)
40
41pw_cc_library(
42 name = "freelist",
43 srcs = [
44 "freelist.cc",
45 ],
46 hdrs = [
47 "public/pw_allocator/freelist.h",
48 ],
49 includes = ["public"],
50 deps = [
51 "//pw_containers",
52 "//pw_span",
53 "//pw_status",
54 ],
55)
56
Jamie Garsidef65bb9c2020-04-02 11:17:20 +010057pw_cc_library(
58 name = "freelist_heap",
59 srcs = [
60 "freelist_heap.cc",
61 ],
62 hdrs = [
63 "public/pw_allocator/freelist_heap.h",
64 ],
Nathaniel Broughc2d57812021-04-18 22:52:00 +080065 includes = ["public"],
Jamie Garsidef65bb9c2020-04-02 11:17:20 +010066 deps = [
67 ":block",
68 ":freelist",
Nathaniel Broughc2d57812021-04-18 22:52:00 +080069 "//pw_log",
Jamie Garsidef65bb9c2020-04-02 11:17:20 +010070 ],
71)
72
Jamie Garside558e1442020-03-27 17:05:55 +000073pw_cc_test(
74 name = "block_test",
75 srcs = [
76 "block_test.cc",
77 ],
78 deps = [
79 ":block",
Rob Mohr0b8d5b12020-04-20 10:14:50 -070080 "//pw_span",
81 "//pw_unit_test",
Jamie Garside558e1442020-03-27 17:05:55 +000082 ],
83)
84
85pw_cc_test(
86 name = "freelist_test",
87 srcs = [
88 "freelist_test.cc",
89 ],
90 deps = [
91 ":freelist",
Rob Mohr0b8d5b12020-04-20 10:14:50 -070092 "//pw_span",
93 "//pw_status",
94 "//pw_unit_test",
Jamie Garside558e1442020-03-27 17:05:55 +000095 ],
96)
Jamie Garsidef65bb9c2020-04-02 11:17:20 +010097
98pw_cc_test(
99 name = "freelist_heap_test",
100 srcs = [
101 "freelist_heap_test.cc",
102 ],
103 deps = [
104 ":freelist_heap",
105 ],
106)