1*6777b538SAndroid Build Coastguard Worker# Copyright 2019 The Chromium Authors 2*6777b538SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*6777b538SAndroid Build Coastguard Worker# found in the LICENSE file. 4*6777b538SAndroid Build Coastguard Worker 5*6777b538SAndroid Build Coastguard Workerimport("//base/allocator/partition_allocator/partition_alloc.gni") 6*6777b538SAndroid Build Coastguard Worker 7*6777b538SAndroid Build Coastguard Worker# Chromium-specific asserts. External embedders _may_ elect to use these 8*6777b538SAndroid Build Coastguard Worker# features even without PA-E. 9*6777b538SAndroid Build Coastguard Workerif (!use_partition_alloc_as_malloc) { 10*6777b538SAndroid Build Coastguard Worker # In theory, BackupRefPtr will work just fine without 11*6777b538SAndroid Build Coastguard Worker # PartitionAlloc-Everywhere, but its scope would be limited to partitions 12*6777b538SAndroid Build Coastguard Worker # that are invoked explicitly (not via malloc). These are only Blink 13*6777b538SAndroid Build Coastguard Worker # partition, where we currently don't even use raw_ptr<T>. 14*6777b538SAndroid Build Coastguard Worker assert(!enable_backup_ref_ptr_support, 15*6777b538SAndroid Build Coastguard Worker "Chromium does not use BRP without PA-E") 16*6777b538SAndroid Build Coastguard Worker 17*6777b538SAndroid Build Coastguard Worker # Pointer compression works only if all pointers are guaranteed to be 18*6777b538SAndroid Build Coastguard Worker # allocated by PA (in one of its core pools, to be precise). In theory, 19*6777b538SAndroid Build Coastguard Worker # this could be useful with partitions that are invoked explicitly. In 20*6777b538SAndroid Build Coastguard Worker # practice, the pointers we have in mind for compression (scoped_refptr<>, 21*6777b538SAndroid Build Coastguard Worker # unique_ptr<>) require PA-E. 22*6777b538SAndroid Build Coastguard Worker assert(!enable_pointer_compression_support, 23*6777b538SAndroid Build Coastguard Worker "Pointer compressions likely doesn't make sense without PA-E") 24*6777b538SAndroid Build Coastguard Worker} 25*6777b538SAndroid Build Coastguard Worker 26*6777b538SAndroid Build Coastguard Workerassert(use_allocator_shim || !use_partition_alloc_as_malloc, 27*6777b538SAndroid Build Coastguard Worker "PartitionAlloc-Everywhere requires the allocator shim") 28