Various minor changes to aid compiling with std14 (#182)

These changes make the code compile in clang10 with -std14.
This commit is contained in:
Matthew Parkinson
2020-05-07 15:02:31 +01:00
committed by GitHub
parent c899ee7ab2
commit a9cfc3a2b4
9 changed files with 13 additions and 11 deletions

View File

@@ -121,6 +121,7 @@ namespace snmalloc
}
Cmp(const Cmp&) = delete;
Cmp(Cmp&&) noexcept = default;
};
// This method is used in Verona

View File

@@ -14,7 +14,7 @@ namespace snmalloc
class Singleton
{
inline static std::atomic_flag flag;
inline static std::atomic<bool> initialised = false;
inline static std::atomic<bool> initialised{false};
inline static Object obj;
public:

View File

@@ -14,7 +14,7 @@ namespace snmalloc
std::is_same<decltype(T::next), std::atomic<T*>>::value,
"T->next must be a std::atomic<T*>");
std::atomic<T*> back = nullptr;
std::atomic<T*> back{nullptr};
T* front = nullptr;
public:
@@ -72,10 +72,10 @@ namespace snmalloc
SNMALLOC_ASSERT(front);
std::atomic_thread_fence(std::memory_order_acquire);
invariant();
return std::pair(first, true);
return {first, true};
}
return std::pair(nullptr, false);
return {nullptr, false};
}
};
} // namespace snmalloc