From: John Tobey Date: Tue, 28 Nov 2000 01:13:41 +0000 (-0500) Subject: Re: [ID 20001127.002] const subs hurt under debugger X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0768512c1c388195d89e987b4c5fbb79e0c00e0e;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20001127.002] const subs hurt under debugger Message-Id: plus a performance speedup noticed by Sarathy. p4raw-id: //depot/perl@7914 --- diff --git a/op.c b/op.c index 07d147d..3b04fc0 100644 --- a/op.c +++ b/op.c @@ -4569,17 +4569,11 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) if (const_sv) { SvREFCNT_inc(const_sv); if (cv) { - cv_undef(cv); -#ifdef USE_THREADS - New(666, CvMUTEXP(cv), 1, perl_mutex); - MUTEX_INIT(CvMUTEXP(cv)); - CvOWNER(cv) = 0; -#endif /* USE_THREADS */ + assert(!CvROOT(cv) && !CvCONST(cv)); sv_setpv((SV*)cv, ""); /* prototype is "" */ CvXSUBANY(cv).any_ptr = const_sv; CvXSUB(cv) = const_sv_xsub; CvCONST_on(cv); - /* XXX Does anybody care that CvFILE(cv) is blank? */ } else { GvCV(gv) = Nullcv; @@ -6939,6 +6933,6 @@ const_sv_xsub(pTHXo_ CV* cv) { dXSARGS; EXTEND(sp, 1); - ST(0) = sv_2mortal(SvREFCNT_inc((SV*)XSANY.any_ptr)); + ST(0) = (SV*)XSANY.any_ptr; XSRETURN(1); }