Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | # Copyright 2019 The Chromium Authors |
Nico Weber | b80b085 | 2019-08-01 22:03:01 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Arthur Sonzogni | c8ca4652 | 2023-10-16 19:08:55 | [diff] [blame] | 5 | import("//base/allocator/partition_allocator/partition_alloc.gni") |
Bartek Nowierski | ceb2fb3 | 2021-05-26 15:09:05 | [diff] [blame] | 6 | |
Bartek Nowierski | f558565 | 2022-11-30 05:45:17 | [diff] [blame] | 7 | # Chromium-specific asserts. External embedders _may_ elect to use these |
| 8 | # features even without PA-E. |
Kalvin Lee | 49aa6cc | 2022-11-09 05:09:57 | [diff] [blame] | 9 | if (!use_partition_alloc_as_malloc) { |
Kalvin Lee | 52c9031 | 2023-03-14 05:41:31 | [diff] [blame] | 10 | # In theory, BackupRefPtr will work just fine without |
| 11 | # PartitionAlloc-Everywhere, but its scope would be limited to partitions |
Bartek Nowierski | f558565 | 2022-11-30 05:45:17 | [diff] [blame] | 12 | # that are invoked explicitly (not via malloc). These are only Blink |
| 13 | # partition, where we currently don't even use raw_ptr<T>. |
Kalvin Lee | 49aa6cc | 2022-11-09 05:09:57 | [diff] [blame] | 14 | assert(!enable_backup_ref_ptr_support, |
| 15 | "Chromium does not use BRP without PA-E") |
Bartek Nowierski | e80ad273 | 2022-11-30 09:52:18 | [diff] [blame] | 16 | |
| 17 | # Pointer compression works only if all pointers are guaranteed to be |
| 18 | # allocated by PA (in one of its core pools, to be precise). In theory, |
| 19 | # this could be useful with partitions that are invoked explicitly. In |
| 20 | # practice, the pointers we have in mind for compression (scoped_refptr<>, |
| 21 | # unique_ptr<>) require PA-E. |
| 22 | assert(!enable_pointer_compression_support, |
| 23 | "Pointer compressions likely doesn't make sense without PA-E") |
Kalvin Lee | 49aa6cc | 2022-11-09 05:09:57 | [diff] [blame] | 24 | } |
Kalvin Lee | 3f2cb61 | 2023-08-07 05:48:48 | [diff] [blame] | 25 | |
| 26 | assert(use_allocator_shim || !use_partition_alloc_as_malloc, |
| 27 | "PartitionAlloc-Everywhere requires the allocator shim") |