blob: 02ef1f3b4639364fdbec653c827f42cc69b7d506 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061# Copyright 2019 The Chromium Authors
Nico Weberb80b0852019-08-01 22:03:012# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Arthur Sonzognic8ca46522023-10-16 19:08:555import("//base/allocator/partition_allocator/partition_alloc.gni")
Bartek Nowierskiceb2fb32021-05-26 15:09:056
Bartek Nowierskif5585652022-11-30 05:45:177# Chromium-specific asserts. External embedders _may_ elect to use these
8# features even without PA-E.
Kalvin Lee49aa6cc2022-11-09 05:09:579if (!use_partition_alloc_as_malloc) {
Kalvin Lee52c90312023-03-14 05:41:3110 # In theory, BackupRefPtr will work just fine without
11 # PartitionAlloc-Everywhere, but its scope would be limited to partitions
Bartek Nowierskif5585652022-11-30 05:45:1712 # that are invoked explicitly (not via malloc). These are only Blink
13 # partition, where we currently don't even use raw_ptr<T>.
Kalvin Lee49aa6cc2022-11-09 05:09:5714 assert(!enable_backup_ref_ptr_support,
15 "Chromium does not use BRP without PA-E")
Bartek Nowierskie80ad2732022-11-30 09:52:1816
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 Lee49aa6cc2022-11-09 05:09:5724}
Kalvin Lee3f2cb612023-08-07 05:48:4825
26assert(use_allocator_shim || !use_partition_alloc_as_malloc,
27 "PartitionAlloc-Everywhere requires the allocator shim")