aboutsummaryrefslogtreecommitdiffstats
path: root/al/buffer.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-05 14:51:03 -0800
committerChris Robinson <[email protected]>2022-12-05 14:51:03 -0800
commitdf6d61dd40b602af55f903564358b083bb8b37e4 (patch)
tree84113a098867e2ba82aa1f156911e94755fde727 /al/buffer.cpp
parent73df39b8f8cefa0c0fca0e287b548063e9e62636 (diff)
Use standard likely/unlikely attributes when available
Diffstat (limited to 'al/buffer.cpp')
-rw-r--r--al/buffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp
index d427f214..77b484d0 100644
--- a/al/buffer.cpp
+++ b/al/buffer.cpp
@@ -1766,7 +1766,7 @@ START_API_FUNC
continue;
const auto al_buffer = LookupBuffer(device, buffer);
- if (!al_buffer)
+ if(!al_buffer) [[alunlikely]]
{
ERR(EAX_PREFIX "Invalid buffer ID %u.\n", buffer);
return ALC_FALSE;
@@ -1782,7 +1782,7 @@ START_API_FUNC
* buffer ID is specified multiple times in the provided list, it
* counts each instance as more memory that needs to fit in X-RAM.
*/
- if(unlikely(std::numeric_limits<size_t>::max()-al_buffer->OriginalSize < total_needed))
+ if(std::numeric_limits<size_t>::max()-al_buffer->OriginalSize < total_needed) [[alunlikely]]
{
context->setError(AL_OUT_OF_MEMORY, EAX_PREFIX "Buffer size overflow (%u + %zu)\n",
al_buffer->OriginalSize, total_needed);