summaryrefslogtreecommitdiff
path: root/mg_vtable.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2020-10-19 16:01:49 +0100
committerDavid Mitchell <davem@iabyn.com>2020-10-23 14:25:52 +0100
commit02a48966c3f10e905b24f9bd307fa31c05060908 (patch)
tree5e53a6e6b781f76381e6e386114fc9ea60dac581 /mg_vtable.h
parent032a49194dbdca7f62038e1b4af134d72972ecd8 (diff)
downloadperl-02a48966c3f10e905b24f9bd307fa31c05060908.tar.gz
add Perl_magic_freemglob() magic vtable method
S_mg_free_struct() has a workaround to never free mg->mg_ptr for PERL_MAGIC_regex_global. Move this logic into a new magic vtable free method instead, so that S_mg_free_struct() (which gets called for every type of magic) doesn't have the overhead of checking every time for mg->mg_type == PERL_MAGIC_regex_global. [ No, I don't know why PERL_MAGIC_regex_global's vtable and methods are suffixed mglob rather than regex_global or vice versa ]
Diffstat (limited to 'mg_vtable.h')
-rw-r--r--mg_vtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg_vtable.h b/mg_vtable.h
index 8815d697ca..e5c8cba37c 100644
--- a/mg_vtable.h
+++ b/mg_vtable.h
@@ -172,7 +172,7 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = {
{ 0, Perl_magic_setisa, 0, Perl_magic_clearisa, 0, 0, 0, 0 },
{ 0, Perl_magic_setisa, 0, 0, 0, 0, 0, 0 },
{ 0, Perl_magic_setlvref, 0, 0, 0, 0, 0, 0 },
- { 0, Perl_magic_setmglob, 0, 0, 0, 0, 0, 0 },
+ { 0, Perl_magic_setmglob, 0, 0, Perl_magic_freemglob, 0, 0, 0 },
{ Perl_magic_getnkeys, Perl_magic_setnkeys, 0, 0, 0, 0, 0, 0 },
{ 0, Perl_magic_setnonelem, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, Perl_magic_freeovrld, 0, 0, 0 },