1# 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 23licenses(["notice"]) 24 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 = [ 35 "//pw_assert", 36 "//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 57pw_cc_library( 58 name = "freelist_heap", 59 srcs = [ 60 "freelist_heap.cc", 61 ], 62 hdrs = [ 63 "public/pw_allocator/freelist_heap.h", 64 ], 65 includes = ["public"], 66 deps = [ 67 ":block", 68 ":freelist", 69 "//pw_log", 70 ], 71) 72 73pw_cc_test( 74 name = "block_test", 75 srcs = [ 76 "block_test.cc", 77 ], 78 deps = [ 79 ":block", 80 "//pw_span", 81 "//pw_unit_test", 82 ], 83) 84 85pw_cc_test( 86 name = "freelist_test", 87 srcs = [ 88 "freelist_test.cc", 89 ], 90 deps = [ 91 ":freelist", 92 "//pw_span", 93 "//pw_status", 94 "//pw_unit_test", 95 ], 96) 97 98pw_cc_test( 99 name = "freelist_heap_test", 100 srcs = [ 101 "freelist_heap_test.cc", 102 ], 103 deps = [ 104 ":freelist_heap", 105 ], 106) 107