1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "partition_alloc/address_pool_manager_bitmap.h"
6 
7 #include "partition_alloc/partition_alloc_buildflags.h"
8 #include "partition_alloc/partition_alloc_constants.h"
9 
10 #if !BUILDFLAG(HAS_64_BIT_POINTERS)
11 
12 namespace partition_alloc::internal {
13 
14 namespace {
15 
16 Lock g_lock;
17 
18 }  // namespace
19 
GetLock()20 Lock& AddressPoolManagerBitmap::GetLock() {
21   return g_lock;
22 }
23 
24 std::bitset<AddressPoolManagerBitmap::kRegularPoolBits>
25     AddressPoolManagerBitmap::regular_pool_bits_;  // GUARDED_BY(GetLock())
26 std::bitset<AddressPoolManagerBitmap::kBRPPoolBits>
27     AddressPoolManagerBitmap::brp_pool_bits_;  // GUARDED_BY(GetLock())
28 #if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
29 std::array<std::atomic_bool,
30            AddressPoolManagerBitmap::kAddressSpaceSize / kSuperPageSize>
31     AddressPoolManagerBitmap::brp_forbidden_super_page_map_;
32 std::atomic_size_t AddressPoolManagerBitmap::blocklist_hit_count_;
33 #endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
34 
35 }  // namespace partition_alloc::internal
36 
37 #endif  // !BUILDFLAG(HAS_64_BIT_POINTERS)
38