From 5648c0ae71de0db3ebfb4199727bc21e89c146c0 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sun, 1 Aug 2010 15:18:51 +0100 Subject: 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. --- mg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mg.c') 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 -- cgit v1.2.1