summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2000-12-15 00:26:57 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-15 15:38:30 +0000
commit32251b26ec0781f53d9925938cad5bd9e89c80f2 (patch)
treeb4e269ef285eacd12a1e4b19ce557bccc7c14590 /sv.c
parent89ffc314668a83ba2b452e1498a0e37c4453876e (diff)
downloadperl-32251b26ec0781f53d9925938cad5bd9e89c80f2.tar.gz
speeding up object creation/destruction 4x times
Message-ID: <20001215052657.A8319@math.mps.ohio-state.edu> p4raw-id: //depot/perl@8131
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 7c9c4dbe68..46d11ffb2d 100644
--- a/sv.c
+++ b/sv.c
@@ -3721,7 +3721,7 @@ Perl_sv_clear(pTHX_ register SV *sv)
if (SvOBJECT(sv)) {
if (PL_defstash) { /* Still have a symbol table? */
djSP;
- GV* destructor;
+ CV* destructor;
SV tmpref;
Zero(&tmpref, 1, SV);
@@ -3730,9 +3730,9 @@ Perl_sv_clear(pTHX_ register SV *sv)
SvREADONLY_on(&tmpref); /* DESTROY() could be naughty */
SvREFCNT(&tmpref) = 1;
- do {
+ do {
stash = SvSTASH(sv);
- destructor = gv_fetchmethod(SvSTASH(sv), "DESTROY");
+ destructor = StashHANDLER(stash,DESTROY);
if (destructor) {
ENTER;
PUSHSTACKi(PERLSI_DESTROY);
@@ -3741,8 +3741,7 @@ Perl_sv_clear(pTHX_ register SV *sv)
PUSHMARK(SP);
PUSHs(&tmpref);
PUTBACK;
- call_sv((SV*)GvCV(destructor),
- G_DISCARD|G_EVAL|G_KEEPERR);
+ call_sv((SV*)destructor, G_DISCARD|G_EVAL|G_KEEPERR);
SvREFCNT(sv)--;
POPSTACK;
SPAGAIN;