diff options
author | David Mitchell <davem@iabyn.com> | 2010-08-01 15:18:51 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-08-01 21:47:31 +0100 |
commit | 5648c0ae71de0db3ebfb4199727bc21e89c146c0 (patch) | |
tree | 6154d88ceb21e1a21bfa48cbe08a805564149b0e /mg.c | |
parent | 757971c467ea1792cbf102db9a0cc3a9dde58fea (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |