Add an Architecture Abstraction Layer.

Currently, we support one architecture, but this provides a layer for
adding other architectures without adding more nested `#ifdef`s.

Fixes #42
This commit is contained in:
David Chisnall
2019-07-10 10:42:59 +01:00
parent e594377b8a
commit 7eabea01d6
10 changed files with 214 additions and 115 deletions

View File

@@ -65,7 +65,7 @@ namespace snmalloc
{
CurrentMaxPair count;
CurrentMaxPair slab_count;
uint64_t time = bits::tick();
uint64_t time = AAL::tick();
uint64_t ticks = 0;
double online_average = 0;
@@ -82,7 +82,7 @@ namespace snmalloc
void addToRunningAverage()
{
uint64_t now = bits::tick();
uint64_t now = AAL::tick();
if (slab_count.current != 0)
{

View File

@@ -154,7 +154,7 @@ namespace snmalloc
while (address_cast(e->load(std::memory_order_relaxed)) ==
LOCKED_ENTRY)
{
bits::pause();
AAL::pause();
}
value = e->load(std::memory_order_acquire);
}