#include "partition_alloc/compressed_pointer.h"
#include "partition_alloc/buildflags.h"
#if PA_BUILDFLAG(ENABLE_POINTER_COMPRESSION)
namespace partition_alloc::internal {
alignas(kPartitionCachelineSize)
PA_COMPONENT_EXPORT(PARTITION_ALLOC) CompressedPointerBaseGlobal::Base
CompressedPointerBaseGlobal::g_base_ = {.base = kUsefulBitsMask};
void CompressedPointerBaseGlobal::SetBase(uintptr_t base) {
PA_DCHECK(!IsSet());
PA_DCHECK((base & kUsefulBitsMask) == 0);
g_base_.base = base | kUsefulBitsMask;
}
void CompressedPointerBaseGlobal::ResetBaseForTesting() {
g_base_.base = kUsefulBitsMask;
}
}
#endif