Add a couple of likely annotations.

This commit is contained in:
Matthew Parkinson
2019-06-26 16:53:39 +01:00
parent 90a0274743
commit 830b06a616
2 changed files with 2 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ namespace snmalloc
// If defined should be initially false;
assert(first == nullptr || *first == false);
if (!initialised.load(std::memory_order_acquire))
if (unlikely(!initialised.load(std::memory_order_acquire)))
{
FlagLock lock(flag);
if (!initialised)

View File

@@ -284,7 +284,7 @@ namespace snmalloc
{
Alloc*& per_thread = inner_get();
if (per_thread != nullptr)
if (likely(per_thread != nullptr))
return per_thread;
// Slow path that performs initialization