proxygen
Likely.h File Reference

Go to the source code of this file.

Macros

#define FOLLY_DETAIL_BUILTIN_EXPECT(b, t)   b
 
#define FOLLY_LIKELY(x)   FOLLY_DETAIL_BUILTIN_EXPECT((x), 1)
 
#define FOLLY_UNLIKELY(x)   FOLLY_DETAIL_BUILTIN_EXPECT((x), 0)
 
#define LIKELY(x)   (x)
 
#define UNLIKELY(x)   (x)
 

Macro Definition Documentation

#define FOLLY_DETAIL_BUILTIN_EXPECT (   b,
 
)    b

Definition at line 22 of file Likely.h.

#define LIKELY (   x)    (x)

Definition at line 47 of file Likely.h.

Referenced by folly::BucketedTimeSeries< VT, CT >::addValueAggregated(), folly::Arena< SysAllocator< void > >::allocate(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::allocationAttempt(), folly::IOBufQueue::WritableRangeCache::append(), folly::compression::bmNext(), folly::compression::bmSkip(), folly::basic_once_flag< SharedMutex >::call_once(), folly::detail::CheckOverflowToDuration< IsFloatingPoint >::check(), folly::XlogLevelInfo< IsInHeaderFile >::check(), folly::ssl::OpenSSLHash::check_libssl_result(), folly::ssl::OpenSSLHash::check_out_size(), folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost(), folly::detail::convertTo(), folly::Try< T >::destroy(), folly::digits10(), folly::futures::detail::Core< T >::doCallback(), folly::io::Appender::ensure(), folly::threadlocal_detail::ThreadEntryNode::eraseZero(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::findInternal(), folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::findInternal(), folly::detail::SingletonHolder< T >::get(), folly::DiscriminatedPtr< Types >::get_nothrow(), folly::Expected< int, E >::hasValue(), folly::hazptr_holder< Atom >::hazptr_holder(), folly::ThreadCachedInt< IntT, Tag >::IntCache::increment(), folly::threadlocal_detail::ThreadEntryNode::initIfZero(), folly::IOBuf::isSharedOne(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::iterateTo(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::jump(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::keyToAnchorIdx(), folly::RWSpinLock::lock(), folly::RWSpinLock::lock_shared(), folly::SharedMutexImpl< true >::lockExclusiveImpl(), folly::fibers::SimpleLoopController::loop(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::moundPop(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::moundPopMany(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::moundPush(), folly::AtomicHashArrayLinearProbeFcn::operator()(), folly::AtomicHashArrayQuadraticProbeFcn::operator()(), folly::hazptr_holder< Atom >::operator=(), folly::detail::posixTimeToDuration(), folly::SaturatingSemaphore< true, Atom >::postFastWaiterMayBlock(), folly::IOBufQueue::preallocate(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pull(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMost(), folly::io::RWCursor< access >::pushAtMost(), folly::io::Appender::pushAtMost(), folly::threadlocal_detail::StaticMetaBase::pushBackLocked(), folly::threadlocal_detail::StaticMetaBase::pushBackUnlocked(), proxygen::HTTP1xCodec::pushHeaderNameAndValue(), folly::io::detail::CursorBase< Cursor, const IOBuf >::read(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedString(), folly::Baton< MayBlock, Atom >::ready(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::regularInsert(), folly::detail::NodeRecycler< NodeType, NodeAlloc, typename std::enable_if< !NodeType::template DestroyIsNoOp< NodeAlloc >::value >::type >::releaseRef(), folly::Expected< int, E >::requireValue(), folly::fibers::Fiber::resume(), folly::fbvector< HTTPHeaderCode >::S_uninitialized_fill_n(), folly::fibers::Baton::setWaiter(), folly::compression::BitVectorReader< Encoder, Instructions, kUnchecked >::skip(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skip(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::skip(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMost(), folly::compression::detail::UpperBitsReader< Encoder, Instructions, SizeType >::skipToNext(), folly::futures::sleep(), folly::detail::splitFixed(), folly::expected_detail::expected_detail_ExpectedHelper::ExpectedHelper::then_(), folly::expected_detail::expected_detail_ExpectedHelper::ExpectedHelper::thenOrThrow_(), folly::fibers::Baton::timedWaitThread(), folly::settings::detail::SettingCore< T >::tlValue(), folly::UnboundedQueue< T, false, 6 >::try_dequeue(), folly::UnboundedQueue< T, false, 6 >::try_dequeue_for(), folly::UnboundedQueue< T, false, 6 >::try_dequeue_until(), folly::SaturatingSemaphore< true, Atom >::try_wait_for(), folly::fibers::Baton::try_wait_until(), folly::SaturatingSemaphore< true, Atom >::try_wait_until(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::tryAddDebit(), folly::tryDecodeVarint(), folly::UnboundedQueue< T, false, 6 >::tryDequeueWaitElem(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::tryEnqueueForImpl(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::tryEnqueueUntilImpl(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryRead(), folly::IOBufQueue::updateWritableTailCache(), folly::uriEscape(), folly::Expected< int, E >::value_or(), folly::fibers::Baton::waitThread(), folly::futures::detail::FutureBase< T >::withinImplementation(), folly::hazptr_holder< Atom >::~hazptr_holder(), and folly::Try< T >::~Try().

#define UNLIKELY (   x)    (x)

Definition at line 48 of file Likely.h.

Referenced by folly::SingletonVault::addEagerInitSingleton(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), folly::BucketedTimeSeries< VT, CT >::addValueAggregated(), folly::Range< unsigned char * >::advance(), folly::ThreadCachedArena::allocate(), folly::detail::BufferedStat< DigestT, ClockT >::append(), folly::SharedMutexImpl< true >::applyDeferredReaders(), folly::fbvector< HTTPHeaderCode >::at(), folly::fibers::Promise< T, BatonT >::await(), bench(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::blockingPushImpl(), folly::bser::bserEncodeArray(), folly::IOBufQueue::chainLength(), folly::detail::CheckOverflowToDuration< IsFloatingPoint >::check(), folly::NotificationQueue< folly::AsyncServerSocket::QueueMessage >::checkDraining(), folly::checkFopenError(), folly::checkFopenErrorExplicit(), folly::checkKernelError(), folly::checkPosixError(), folly::checkUnixError(), folly::checkUnixErrorExplicit(), folly::chrono::clock_gettime_ns_fallback(), folly::io::detail::CursorBase< Cursor, const IOBuf >::clone(), folly::io::detail::CursorBase< Cursor, const IOBuf >::cloneAtMost(), folly::BasicDynamicTokenBucket< Clock >::consumeImpl(), folly::NotificationQueue< MessageT >::Consumer::consumeMessages(), folly::NotificationQueue< MessageT >::SimpleConsumer::consumeUntilDrained(), folly::AccessSpreader< Atom >::CpuCache::cpu(), folly::fbvector< HTTPHeaderCode >::dataIsInternal(), proxygen::GzipHeaderCodec::decode(), folly::detail::LifoSemBase< BatonType, Atom >::decrOrPush(), folly::compression::EliasFanoEncoderV2< Value, SkipValue, kSkipQuantum, kForwardQuantum >::defaultNumLowerBits(), folly::Try< T >::destroy(), folly::digits10(), folly::detail::digits_to(), folly::SingletonVault::doEagerInit(), folly::SingletonVault::doEagerInitVia(), folly::EventCount::doNotify(), duration_to_ts(), folly::detail::durationToPosixTime(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::EliasFanoReader(), folly::FormatArg::enforce(), folly::detail::enforceWhitespaceErr(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::erase(), folly::EventBase::EventBase(), fizz::HkdfImpl< Hash >::expand(), folly::fibers::Fiber::fiberFunc(), folly::detail::SignedValueHandler< T, true >::finalize(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::findInternal(), folly::UnboundedQueue< T, false, 6 >::findSegment(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::forceInsert(), wangle::Observable< T >::forEachObserver(), folly::DiscriminatedPtr< Types >::get(), folly::detail::SingletonHolder< T >::get_weak(), folly::compression::detail::UpperBitsReader< Encoder, Instructions, SizeType >::getPreviousInfo(), folly::threadlocal_detail::StaticMeta< Tag, AccessMode >::getSlowReserveAndCache(), folly::threadlocal_detail::StaticMetaBase::getThreadEntryList(), folly::Expected< int, E >::hasError(), folly::hazptr_array< 3, Atom >::hazptr_array(), folly::hazptr_local< M, Atom >::hazptr_local(), folly::ThreadCachedInt< uint64_t >::increment(), folly::ThreadCachedInt< IntT, Tag >::IntCache::increment(), folly::fibers::Fiber::init(), folly::fbvector< T, Allocator >::Impl::init(), folly::XlogCategoryInfo< IsInHeaderFile >::init(), folly::detail::SignedValueHandler< T, true >::init(), folly::threadlocal_detail::ThreadEntryNode::initIfZero(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::insertInternal(), folly::LeakySingleton< T, Tag >::instance(), folly::IOBuf::isSharedOne(), folly::detail::LifoSemBase< BatonType, Atom >::isShutdown(), folly::XlogLevelInfo< IsInHeaderFile >::loadLevelFull(), folly::SharedMutexImpl< true >::lockExclusiveImpl(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::lockSharedImpl(), folly::fibers::FiberManager::loopUntilNoReadyImpl(), folly::detail::mallctlHelper(), folly::io::RWCursor< access >::maybeUnshare(), folly::compression::BitVectorReader< Encoder, Instructions, kUnchecked >::next(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::next(), folly::detail::CheckTrailingSpace::operator()(), folly::dynamic::operator<(), folly::operator<(), folly::fbvector< HTTPHeaderCode >::operator=(), folly::operator==(), folly::CustomLogFormatter::parseFormatString(), folly::io::detail::CursorBase< Cursor, const IOBuf >::peekBytes(), folly::AsyncIO::pollCompleted(), folly::detail::posixTimeToDuration(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::previous(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pull(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::pullSlow(), folly::io::RWCursor< access >::pushAtMost(), folly::io::Appender::pushAtMost(), folly::detail::qfind_first_byte_of_nosse(), folly::detail::qfind_first_byte_of_sse42(), folly::Range< unsigned char * >::Range(), folly::io::detail::CursorBase< Cursor, const IOBuf >::readFixedStringSlow(), folly::detail::distributed_mutex::recordTimedWaiterAndClearTimedBit(), folly::SingletonVault::registerSingleton(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::regularInsert(), folly::Expected< int, E >::requireError(), folly::Expected< int, E >::requireValue(), folly::IOBuf::reserveSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::retreatSlow(), folly::futures::detail::retryingJitteredExponentialBackoffDur(), folly::fibers::FiberManager::runInMainContext(), folly::fibers::runInMainContext(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipAtMostSlow(), folly::io::detail::CursorBase< Cursor, const IOBuf >::skipSlow(), folly::compression::EliasFanoReader< Encoder, Instructions, kUnchecked, SizeType >::skipTo(), folly::futures::sleep(), folly::IOBufQueue::split(), folly::detail::splitFixed(), folly::detail::str_to_integral(), folly::json::stripComments(), folly::Range< unsigned char * >::subpiece(), folly::Range< unsigned char * >::subtract(), folly::IOBuf::takeOwnershipIov(), folly::CPUThreadPoolExecutor::threadRun(), folly::detail::SingletonHolder< T >::try_get(), folly::detail::SingletonHolder< T >::try_get_fast(), folly::RWSpinLock::try_lock_shared(), folly::hazptr_holder< Atom >::try_protect(), folly::detail::LifoSemBase< BatonType, Atom >::try_wait_until(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryAdvanceBuffer(), folly::NotificationQueue< folly::AsyncServerSocket::QueueMessage >::tryConsume(), folly::UnboundedQueue< T, false, 6 >::tryDequeueUntilMC(), folly::UnboundedQueue< T, false, 6 >::tryDequeueUntilSC(), folly::UnboundedQueue< T, false, 6 >::tryPeekUntil(), folly::detail::tryPosixTimeToDuration(), folly::io::detail::CursorBase< Cursor, const IOBuf >::tryRetreatBuffer(), folly::detail::distributed_mutex::tryUnlockClean(), folly::TLRefCount::LocalRefCount::update(), folly::Uri::Uri(), folly::uriUnescape(), folly::detail::SingletonHolder< T >::vivify(), folly::SharedMutexImpl< true >::waitForZeroBits(), folly::SharedMutexImpl< true >::wakeRegisteredWaiters(), folly::detail::distributed_mutex::wakeTimedWaiters(), folly::futures::detail::FutureBase< T >::withinImplementation(), folly::detail::LifoSemHead::withValueIncr(), folly::IOBuf::wrapIov(), wangle::AsyncSocketHandler::write(), folly::AsyncUDPSocket::writeGSO(), ConnectedWriteUDPClient::writePing(), folly::hazptr_array< 3, Atom >::~hazptr_array(), folly::SharedMutexImpl< true >::~SharedMutexImpl(), and folly::Try< T >::~Try().