/*
 * Copyright 2026 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#include "tools/partition_alloc/TestSupport.h"

#include <partition_alloc/buildflags.h>

#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
#include <partition_alloc/shim/allocator_shim.h>
#include <partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h>
#endif

namespace skiatest {

void InitializePartitionAllocForTesting() {
#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
    allocator_shim::ConfigurePartitionsForTesting();
    allocator_shim::internal::PartitionAllocMalloc::Allocator()->EnableThreadCacheIfSupported();
#endif
}

}  // namespace skiatest
