diff options
author | Steffen Mueller <smueller@cpan.org> | 2013-03-06 20:39:43 +0100 |
---|---|---|
committer | Steffen Mueller <smueller@cpan.org> | 2013-03-06 20:39:43 +0100 |
commit | 2439e03355dec26654acf614900c077433bc27e0 (patch) | |
tree | 9bd0e7345aad6371d1f45065e869d791fb604c0c /inline.h | |
parent | 8da3792e39c8a8877091f33438f7191493dbefea (diff) | |
download | perl-2439e03355dec26654acf614900c077433bc27e0.tar.gz |
(UN)LIKELY branch prediction hints in a few strategic places
This adds branch prediction hints to a few strategic places such as
growing stack or strings, some exception handling, and a few hot
functions such as sv_upgrade.
This is not exhaustive by any means.
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -46,7 +46,7 @@ S_ReANY(const REGEXP * const re) PERL_STATIC_INLINE SV * S_SvREFCNT_inc(SV *sv) { - if (sv) + if (LIKELY(sv != NULL)) SvREFCNT(sv)++; return sv; } @@ -59,13 +59,13 @@ S_SvREFCNT_inc_NN(SV *sv) PERL_STATIC_INLINE void S_SvREFCNT_inc_void(SV *sv) { - if (sv) + if (LIKELY(sv != NULL)) SvREFCNT(sv)++; } PERL_STATIC_INLINE void S_SvREFCNT_dec(pTHX_ SV *sv) { - if (sv) { + if (LIKELY(sv != NULL)) { U32 rc = SvREFCNT(sv); if (rc > 1) SvREFCNT(sv) = rc - 1; |