Commit 93599534 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

notes for FOLLY_UNLIKELY

Summary: A note describing some ways compilers infer unlikeliness.

Reviewed By: iahs

Differential Revision: D27298067

fbshipit-source-id: c2e0409aa6f0e95f6e68724f56a0e53a47d9a19e
parent fa02762b
......@@ -31,6 +31,12 @@
// paths are designed as the fast path and which are designed as the slow path,
// and to force the compiler to optimize for the fast path, even when it is not
// overwhelmingly likely.
//
// Notes:
// * All supported compilers treat unconditionally-noreturn blocks as unlikely.
// This is true for blocks which unconditionally throw exceptions and for
// blocks which unconditionally call [[noreturn]]-annotated functions. Such
// cases do not require likeliness annotations.
#define FOLLY_LIKELY(x) FOLLY_DETAIL_BUILTIN_EXPECT((x), 1)
#define FOLLY_UNLIKELY(x) FOLLY_DETAIL_BUILTIN_EXPECT((x), 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment