#ifndef PARTITION_ALLOC_FREE_HINT_H_
#define PARTITION_ALLOC_FREE_HINT_H_
#include <cstddef>
#include "partition_alloc/partition_alloc_constants.h"
namespace partition_alloc {
namespace internal {
template <typename EnumType>
constexpr inline EnumType FreeHintFlags(EnumType superset) {
return (superset &
(FreeFlags::kWithSizeHint | FreeFlags::kWithAlignmentHint));
}
}
template <FreeFlags free_flags>
struct FreeHint {
typedef std::nullptr_t Type;
};
template <>
struct FreeHint<FreeFlags::kWithSizeHint> {
struct Type {
size_t size = 0;
};
};
template <>
struct FreeHint<FreeFlags::kWithSizeHint | FreeFlags::kWithAlignmentHint> {
struct Type {
size_t size = 0;
size_t alignment = 0;
};
};
template <FreeFlags flags>
using FreeHintType = typename FreeHint<flags>::Type;
}
#endif