Move pagemap to using InvalidPointer.
Replace a constant `uintptr_t` value of 1 that was repeatedly cast to a pointer with an `InvalidPointer<1>`.
This commit is contained in:
@@ -10,7 +10,7 @@ namespace snmalloc
|
||||
* Invalid pointer class. This is similar to `std::nullptr_t`, but allows
|
||||
* other values.
|
||||
*/
|
||||
template<uintptr_t Sentinel>
|
||||
template<address_t Sentinel>
|
||||
struct InvalidPointer
|
||||
{
|
||||
/**
|
||||
@@ -40,10 +40,17 @@ namespace snmalloc
|
||||
* systems the sentinel should be a value in unmapped memory.
|
||||
*/
|
||||
template<typename T>
|
||||
operator T*()
|
||||
operator T*() const
|
||||
{
|
||||
return reinterpret_cast<T*>(Sentinel);
|
||||
}
|
||||
/**
|
||||
* Implicit conversion to an address, returns the sentinel value.
|
||||
*/
|
||||
operator address_t() const
|
||||
{
|
||||
return Sentinel;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T, class Terminator = std::nullptr_t>
|
||||
|
||||
Reference in New Issue
Block a user