#ifndef PARTITION_ALLOC_PARTITION_DIRECT_MAP_EXTENT_H_
#define PARTITION_ALLOC_PARTITION_DIRECT_MAP_EXTENT_H_
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_check.h"
#include "partition_alloc/partition_bucket.h"
#include "partition_alloc/partition_page.h"
namespace partition_alloc::internal {
template <MetadataKind kind>
struct PartitionDirectMapExtent;
template <MetadataKind kind>
struct PartitionDirectMapExtentBase { … };
template <MetadataKind kind>
struct PartitionDirectMapExtent;
template <>
struct PartitionDirectMapExtent<MetadataKind::kReadOnly>
: public PartitionDirectMapExtentBase<MetadataKind::kReadOnly> { … };
template <>
struct PartitionDirectMapExtent<MetadataKind::kWritable>
: public PartitionDirectMapExtentBase<MetadataKind::kWritable> { … };
template <MetadataKind kind>
struct PartitionDirectMapMetadataBase { … };
template <MetadataKind kind>
struct PartitionDirectMapMetadata;
template <>
struct PartitionDirectMapMetadata<MetadataKind::kReadOnly>
: public PartitionDirectMapMetadataBase<MetadataKind::kReadOnly> { … };
template <>
struct PartitionDirectMapMetadata<MetadataKind::kWritable>
: public PartitionDirectMapMetadataBase<MetadataKind::kWritable> { … };
PA_ALWAYS_INLINE PartitionDirectMapMetadata<MetadataKind::kReadOnly>*
PartitionDirectMapMetadata<MetadataKind::kReadOnly>::FromSlotSpanMetadata(
SlotSpanMetadata* slot_span) { … }
PA_ALWAYS_INLINE PartitionDirectMapExtent<MetadataKind::kReadOnly>*
PartitionDirectMapExtent<MetadataKind::kReadOnly>::FromSlotSpanMetadata(
SlotSpanMetadata* slot_span) { … }
PA_ALWAYS_INLINE PartitionDirectMapMetadata<MetadataKind::kWritable>*
PartitionDirectMapMetadata<MetadataKind::kReadOnly>::ToWritable(
const PartitionRoot* root) { … }
template <typename T>
PartitionDirectMapMetadata<MetadataKind::kWritable>*
PartitionDirectMapMetadata<MetadataKind::kReadOnly>::ToWritableInternal(
[[maybe_unused]] T* root) { … }
PA_ALWAYS_INLINE PartitionDirectMapExtent<MetadataKind::kWritable>*
PartitionDirectMapExtent<MetadataKind::kReadOnly>::ToWritable(
const PartitionRoot* root) { … }
template <typename T>
PartitionDirectMapExtent<MetadataKind::kWritable>*
PartitionDirectMapExtent<MetadataKind::kReadOnly>::ToWritableInternal(
[[maybe_unused]] T* root) { … }
#if PA_BUILDFLAG(DCHECKS_ARE_ON)
PA_ALWAYS_INLINE PartitionDirectMapMetadata<MetadataKind::kReadOnly>*
PartitionDirectMapMetadata<MetadataKind::kReadOnly>::ToReadOnly() { … }
PA_ALWAYS_INLINE PartitionDirectMapMetadata<MetadataKind::kReadOnly>*
PartitionDirectMapMetadata<MetadataKind::kWritable>::ToReadOnly(
const PartitionRoot* root) { … }
template <typename T>
PartitionDirectMapMetadata<MetadataKind::kReadOnly>*
PartitionDirectMapMetadata<MetadataKind::kWritable>::ToReadOnlyInternal(
[[maybe_unused]] T* root) { … }
PA_ALWAYS_INLINE PartitionDirectMapExtent<MetadataKind::kReadOnly>*
PartitionDirectMapExtent<MetadataKind::kReadOnly>::ToReadOnly() { … }
PA_ALWAYS_INLINE PartitionDirectMapExtent<MetadataKind::kReadOnly>*
PartitionDirectMapExtent<MetadataKind::kWritable>::ToReadOnly(
const PartitionRoot* root) { … }
template <typename T>
PartitionDirectMapExtent<MetadataKind::kReadOnly>*
PartitionDirectMapExtent<MetadataKind::kWritable>::ToReadOnlyInternal(
[[maybe_unused]] T* root) { … }
#endif
}
#endif