xref: /aosp_15_r20/external/cronet/base/allocator/allocator.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2019 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
5import("//base/allocator/partition_allocator/partition_alloc.gni")
6
7# Chromium-specific asserts. External embedders _may_ elect to use these
8# features even without PA-E.
9if (!use_partition_alloc_as_malloc) {
10  # In theory, BackupRefPtr will work just fine without
11  # PartitionAlloc-Everywhere, but its scope would be limited to partitions
12  # that are invoked explicitly (not via malloc). These are only Blink
13  # partition, where we currently don't even use raw_ptr<T>.
14  assert(!enable_backup_ref_ptr_support,
15         "Chromium does not use BRP without PA-E")
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")
24}
25
26assert(use_allocator_shim || !use_partition_alloc_as_malloc,
27       "PartitionAlloc-Everywhere requires the allocator shim")
28