Add a couple of likely annotations.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user