xref: /aosp_15_r20/external/pdfium/testing/allocator_shim_config.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2023 The PDFium Authors
2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file.
4*3ac0a46fSAndroid Build Coastguard Worker 
5*3ac0a46fSAndroid Build Coastguard Worker #include "testing/allocator_shim_config.h"
6*3ac0a46fSAndroid Build Coastguard Worker 
7*3ac0a46fSAndroid Build Coastguard Worker #include "base/allocator/partition_allocator/partition_alloc_buildflags.h"
8*3ac0a46fSAndroid Build Coastguard Worker #include "base/allocator/partition_allocator/shim/allocator_shim.h"
9*3ac0a46fSAndroid Build Coastguard Worker 
10*3ac0a46fSAndroid Build Coastguard Worker namespace pdfium {
11*3ac0a46fSAndroid Build Coastguard Worker 
ConfigurePartitionAllocShimPartitionForTest()12*3ac0a46fSAndroid Build Coastguard Worker void ConfigurePartitionAllocShimPartitionForTest() {
13*3ac0a46fSAndroid Build Coastguard Worker #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
14*3ac0a46fSAndroid Build Coastguard Worker #if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
15*3ac0a46fSAndroid Build Coastguard Worker   allocator_shim::ConfigurePartitions(
16*3ac0a46fSAndroid Build Coastguard Worker       allocator_shim::EnableBrp(true),
17*3ac0a46fSAndroid Build Coastguard Worker       allocator_shim::EnableMemoryTagging(false),
18*3ac0a46fSAndroid Build Coastguard Worker       allocator_shim::SplitMainPartition(true),
19*3ac0a46fSAndroid Build Coastguard Worker       allocator_shim::UseDedicatedAlignedPartition(true), 0,
20*3ac0a46fSAndroid Build Coastguard Worker       allocator_shim::BucketDistribution::kNeutral);
21*3ac0a46fSAndroid Build Coastguard Worker #endif  // BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)
22*3ac0a46fSAndroid Build Coastguard Worker #endif  // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
23*3ac0a46fSAndroid Build Coastguard Worker }
24*3ac0a46fSAndroid Build Coastguard Worker 
25*3ac0a46fSAndroid Build Coastguard Worker }  // namespace pdfium
26