summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJohn Tobey <jtobey@john-edwin-tobey.org>2000-11-27 20:13:41 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-29 03:35:01 +0000
commit0768512c1c388195d89e987b4c5fbb79e0c00e0e (patch)
tree406377ef939b12b9e274441ed6f243e1183e1644 /op.c
parent95fa9585889625db75bda5635e618796ea469a6e (diff)
downloadperl-0768512c1c388195d89e987b4c5fbb79e0c00e0e.tar.gz
Re: [ID 20001127.002] const subs hurt under debugger
Message-Id: <m140e1N-000FOoC@feynman.localnet> plus a performance speedup noticed by Sarathy. p4raw-id: //depot/perl@7914
Diffstat (limited to 'op.c')
-rw-r--r--op.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/op.c b/op.c
index 07d147de64..3b04fc0ae9 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);
}