This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Branch prediction hint for SvREFCNT_dec
[perl5.git] / inline.h
index 953bb33..29a15ac 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -67,7 +67,7 @@ S_SvREFCNT_dec(pTHX_ SV *sv)
 {
     if (LIKELY(sv != NULL)) {
        U32 rc = SvREFCNT(sv);
-       if (rc > 1)
+       if (LIKELY(rc > 1))
            SvREFCNT(sv) = rc - 1;
        else
            Perl_sv_free2(aTHX_ sv, rc);
@@ -78,7 +78,7 @@ PERL_STATIC_INLINE void
 S_SvREFCNT_dec_NN(pTHX_ SV *sv)
 {
     U32 rc = SvREFCNT(sv);
-    if (rc > 1)
+    if (LIKELY(rc > 1))
        SvREFCNT(sv) = rc - 1;
     else
        Perl_sv_free2(aTHX_ sv, rc);