AAL: feature flags
This commit is contained in:
@@ -11,6 +11,19 @@
|
|||||||
|
|
||||||
namespace snmalloc
|
namespace snmalloc
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Flags in a bitfield of attributes of this architecture, much like
|
||||||
|
* PalFeatures.
|
||||||
|
*/
|
||||||
|
enum AalFeatures : uint64_t
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* This architecture does not discriminate between integers and pointers,
|
||||||
|
* and so may use bit operations on pointer values.
|
||||||
|
*/
|
||||||
|
IntegerPointers = (1 << 0),
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Architecture Abstraction Layer. Includes default implementations of some
|
* Architecture Abstraction Layer. Includes default implementations of some
|
||||||
* functions using compiler builtins. Falls back to the definitions in the
|
* functions using compiler builtins. Falls back to the definitions in the
|
||||||
@@ -64,6 +77,9 @@ namespace snmalloc
|
|||||||
namespace snmalloc
|
namespace snmalloc
|
||||||
{
|
{
|
||||||
using Aal = AAL_Generic<AAL_Arch>;
|
using Aal = AAL_Generic<AAL_Arch>;
|
||||||
|
|
||||||
|
template<AalFeatures F, typename AAL = Aal>
|
||||||
|
constexpr static bool aal_supports = (AAL::aal_features & F) == F;
|
||||||
} // namespace snmalloc
|
} // namespace snmalloc
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(SNMALLOC_VA_BITS_32)
|
#if defined(_MSC_VER) && defined(SNMALLOC_VA_BITS_32)
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ namespace snmalloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Bitmap of AalFeature flags
|
||||||
|
*/
|
||||||
|
static constexpr uint64_t aal_features = IntegerPointers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On pipelined processors, notify the core that we are in a spin loop and
|
* On pipelined processors, notify the core that we are in a spin loop and
|
||||||
* that speculative execution past this point may not be a performance gain.
|
* that speculative execution past this point may not be a performance gain.
|
||||||
|
|||||||
Reference in New Issue
Block a user