summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-08-01 15:18:51 +0100
committerDavid Mitchell <davem@iabyn.com>2010-08-01 21:47:31 +0100
commit5648c0ae71de0db3ebfb4199727bc21e89c146c0 (patch)
tree6154d88ceb21e1a21bfa48cbe08a805564149b0e /mg.c
parent757971c467ea1792cbf102db9a0cc3a9dde58fea (diff)
downloadperl-5648c0ae71de0db3ebfb4199727bc21e89c146c0.tar.gz
optimise single backreferences
Rather than creating an AV and pushing the backref onto it, store a single backref directly in the mg_obj or xhv_backreferences slot. If the backref is an AV, then we skip this optimisation (although I don't think at the moment, that an AV would ever be pointed to by some backref magic). So the test of whether the optimisation is is in effect is whether the thing in the slot is an AV or not.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 5eca2e51d4..95abbf6f16 100644
--- a/mg.c
+++ b/mg.c
@@ -2255,7 +2255,8 @@ int
Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg)
{
PERL_ARGS_ASSERT_MAGIC_KILLBACKREFS;
- return Perl_sv_kill_backrefs(aTHX_ sv, MUTABLE_AV(mg->mg_obj));
+ Perl_sv_kill_backrefs(aTHX_ sv, MUTABLE_AV(mg->mg_obj));
+ return 0;
}
int