summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-19 08:42:18 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-19 08:42:18 +0000
commitcbf82dd00c19573e7e274a1d8dda9656bc6e259a (patch)
tree85a421e839c6a91506d7a9f972bf553b2cf43845 /mathoms.c
parent39cd7a593a348b713bd3e45241789bcc2a458c1a (diff)
downloadperl-cbf82dd00c19573e7e274a1d8dda9656bc6e259a.tar.gz
Calling cv_undef() on the CV created by newCONSTSUB() would leak like
a Jumblie's preferred maritime craft. To free CvFILE for this case, take advantage of the 0 length prototype that will also be there, and hang it from the prototype. To do this properly means changing code to actually pay attention to SvCUR() on prototypes. It turns out that we always know the length of the prototype string, so this may be faster. Certainly, it's a memory saving (even ignoring the leak). p4raw-id: //depot/perl@27896
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mathoms.c b/mathoms.c
index 967e0353ec..a2511b9f91 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -1236,6 +1236,11 @@ Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len)
sv_usepvn_flags(sv,ptr,len, 0);
}
+void
+Perl_cv_ckproto(pTHX_ const CV *cv, const GV *gv, const char *p)
+{
+ cv_ckproto_len(cv, gv, p, p ? strlen(p) : 0);
+}
#endif /* NO_MATHOMS */
/*