#ifndef PARTITION_ALLOC_PARTITION_BUCKET_LOOKUP_H_
#define PARTITION_ALLOC_PARTITION_BUCKET_LOOKUP_H_
#include <array>
#include <cstdint>
#include <utility>
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/bits.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_check.h"
#include "partition_alloc/partition_alloc_constants.h"
namespace partition_alloc::internal {
constexpr uint8_t OrderIndexShift(uint8_t order) { … }
constexpr size_t OrderSubIndexMask(uint8_t order) { … }
#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
static_assert …;
#else
static_assert(kBitsPerSizeT == 32, "");
#endif
inline constexpr uint8_t kNumOrders = …;
template <typename SizeClass, SizeClass... Index>
constexpr auto MakeOrderArray(SizeClass (*order_function)(uint8_t),
std::integer_sequence<SizeClass, Index...> seq) { … }
inline constexpr auto kOrderIndexShift = …;
inline constexpr auto kOrderSubIndexMask = …;
class BucketIndexLookup final { … };
PA_ALWAYS_INLINE constexpr size_t RoundUpToPowerOfTwo(size_t size) { … }
PA_ALWAYS_INLINE constexpr size_t RoundUpSize(size_t size) { … }
PA_ALWAYS_INLINE constexpr uint16_t RoundUpToOdd(uint16_t size) { … }
PA_ALWAYS_INLINE constexpr uint16_t BucketIndexLookup::GetIndexForDenserBuckets(
size_t size) { … }
PA_ALWAYS_INLINE constexpr uint16_t
BucketIndexLookup::GetIndexForNeutralBuckets(size_t size) { … }
PA_ALWAYS_INLINE constexpr uint16_t BucketIndexLookup::GetIndex(size_t size) { … }
}
#endif