chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_constants.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PARTITION_ALLOC_PARTITION_ALLOC_CONSTANTS_H_
#define PARTITION_ALLOC_PARTITION_ALLOC_CONSTANTS_H_

#include <algorithm>
#include <climits>
#include <cstddef>
#include <limits>

#include "partition_alloc/address_pool_manager_types.h"
#include "partition_alloc/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/flags.h"
#include "partition_alloc/page_allocator_constants.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_config.h"
#include "partition_alloc/partition_alloc_forward.h"

#if PA_BUILDFLAG(IS_APPLE) && PA_BUILDFLAG(PA_ARCH_CPU_64_BITS)
#include <mach/vm_page_size.h>
#endif

#if PA_BUILDFLAG(HAS_MEMORY_TAGGING)
#include "partition_alloc/tagging.h"
#endif

namespace partition_alloc {

internal  // namespace internal

AllocFlags;
FreeFlags;

internal  // namespace internal

// When trying to conserve memory, set the thread cache limit to this.
static inline constexpr size_t kThreadCacheDefaultSizeThreshold =;

// 32kiB is chosen here as from local experiments, "zone" allocation in
// V8 is performance-sensitive, and zones can (and do) grow up to 32kiB for
// each individual allocation.
static inline constexpr size_t kThreadCacheLargeSizeThreshold =;
static_assert;

// These constants are used outside PartitionAlloc itself, so we provide
// non-internal aliases here.
kInvalidBucketSize;
kMaxSuperPagesInPool;
kMaxSupportedAlignment;
kNumBuckets;
kSuperPageSize;
MaxDirectMapped;
PartitionPageSize;

}  // namespace partition_alloc

#endif  // PARTITION_ALLOC_PARTITION_ALLOC_CONSTANTS_H_