summaryrefslogtreecommitdiff
path: root/src/thread_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread_cache.h')
-rw-r--r--src/thread_cache.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/thread_cache.h b/src/thread_cache.h
index 5edcdfb..81a020e 100644
--- a/src/thread_cache.h
+++ b/src/thread_cache.h
@@ -350,7 +350,7 @@ inline void* ThreadCache::Allocate(size_t size, size_t cl) {
ASSERT(size == Static::sizemap()->ByteSizeForClass(cl));
FreeList* list = &list_[cl];
- if (list->empty()) {
+ if (UNLIKELY(list->empty())) {
return FetchFromCentralCache(cl, size);
}
size_ -= size;
@@ -374,7 +374,7 @@ inline void ThreadCache::Deallocate(void* ptr, size_t cl) {
// There are two relatively uncommon things that require further work.
// In the common case we're done, and in that case we need a single branch
// because of the bitwise-or trick that follows.
- if ((list_headroom | size_headroom) < 0) {
+ if (UNLIKELY((list_headroom | size_headroom) < 0)) {
if (list_headroom < 0) {
ListTooLong(list, cl);
}