NFC: Introduce skeletal ds/ptrwrap.h

This lets us go ahead and land several preparatory commits without waiting for
the real AuthPtr<> types to show up.
This commit is contained in:
Nathaniel Filardo
2021-03-15 18:40:34 +00:00
committed by Matthew Parkinson
parent cbab7a3455
commit 73b86e6dff

18
src/ds/ptrwrap.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include <atomic>
namespace snmalloc
{
/**
* To assist in providing a uniform interface regardless of pointer wrapper,
* we also export intrinsic pointer and atomic pointer aliases, as the postfix
* type constructor '*' does not work well as a template parameter and we
* don't have inline type-level functions.
*/
template<typename T>
using Pointer = T*;
template<typename T>
using AtomicPointer = std::atomic<T*>;
} // namespace snmalloc