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