diff options
author | Karl Williamson <khw@cpan.org> | 2019-08-04 18:14:43 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-09-02 21:52:10 -0600 |
commit | c515c80fda3530cf3f562e63012a7e02781fbc17 (patch) | |
tree | da53e0434c03eb388bfe11464122bae0d38ef611 /perl.h | |
parent | b7822a6dc596b40a42a5d599451fa677a9dfb98a (diff) | |
download | perl-c515c80fda3530cf3f562e63012a7e02781fbc17.tar.gz |
perlapi: Document LIKELY, UNLIKELY
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -3514,8 +3514,25 @@ EXTERN_C int perl_tsa_mutex_unlock(perl_mutex* mutex) #else # define EXPECT(expr,val) (expr) #endif + +/* +=head1 Miscellaneous Functions + +=for apidoc AmU|bool|LIKELY|const bool expr + +Returns the input unchanged, but at the same time it gives a branch prediction +hint to the compiler that this condition is likely to be true. + +=for apidoc AmU|bool|UNLIKELY|const bool expr + +Returns the input unchanged, but at the same time it gives a branch prediction +hint to the compiler that this condition is likely to be false. + +=cut +*/ #define LIKELY(cond) EXPECT(cBOOL(cond),TRUE) #define UNLIKELY(cond) EXPECT(cBOOL(cond),FALSE) + #ifdef HAS_BUILTIN_CHOOSE_EXPR /* placeholder */ #endif |