From: Nicholas Clark Date: Tue, 4 Sep 2012 09:54:06 +0000 (+0200) Subject: In Perl_cv_forget_slab(), simplify the conditionally compiled code. X-Git-Tag: upstream/5.20.0~5510^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3e2910579399afd7e086e660f40c5b6793d30a8;p=platform%2Fupstream%2Fperl.git In Perl_cv_forget_slab(), simplify the conditionally compiled code. This refactoring reduces the line count and makes it clear that the basic logic is the same with or without -DPERL_DEBUG_READONLY_OPS. It make no change to the generated assembler on a normal build. --- diff --git a/pad.c b/pad.c index 148fdf8..aba463b 100644 --- a/pad.c +++ b/pad.c @@ -505,9 +505,7 @@ void Perl_cv_forget_slab(pTHX_ CV *cv) { const bool slabbed = !!CvSLABBED(cv); -#ifdef PERL_DEBUG_READONLY_OPS OPSLAB *slab = NULL; -#endif PERL_ARGS_ASSERT_CV_FORGET_SLAB; @@ -515,25 +513,21 @@ Perl_cv_forget_slab(pTHX_ CV *cv) CvSLABBED_off(cv); -#ifdef PERL_DEBUG_READONLY_OPS if (CvROOT(cv)) slab = OpSLAB(CvROOT(cv)); else if (CvSTART(cv)) slab = (OPSLAB *)CvSTART(cv); -#else - if (CvROOT(cv)) OpslabREFCNT_dec(OpSLAB(CvROOT(cv))); - else if (CvSTART(cv)) OpslabREFCNT_dec((OPSLAB *)CvSTART(cv)); -#endif #ifdef DEBUGGING else if (slabbed) Perl_warn(aTHX_ "Slab leaked from cv %p", cv); #endif -#ifdef PERL_DEBUG_READONLY_OPS if (slab) { - size_t refcnt; - refcnt = slab->opslab_refcnt; +#ifdef PERL_DEBUG_READONLY_OPS + const size_t refcnt = slab->opslab_refcnt; +#endif OpslabREFCNT_dec(slab); +#ifdef PERL_DEBUG_READONLY_OPS if (refcnt > 1) Slab_to_ro(slab); - } #endif + } } /*