diff options
author | David Mitchell <davem@iabyn.com> | 2020-10-19 16:01:49 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2020-10-23 14:25:52 +0100 |
commit | 02a48966c3f10e905b24f9bd307fa31c05060908 (patch) | |
tree | 5e53a6e6b781f76381e6e386114fc9ea60dac581 /proto.h | |
parent | 032a49194dbdca7f62038e1b4af134d72972ecd8 (diff) | |
download | perl-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 'proto.h')
-rw-r--r-- | proto.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1857,6 +1857,9 @@ PERL_CALLCONV int Perl_magic_existspack(pTHX_ SV* sv, const MAGIC* mg); PERL_CALLCONV int Perl_magic_freearylen_p(pTHX_ SV* sv, MAGIC* mg); #define PERL_ARGS_ASSERT_MAGIC_FREEARYLEN_P \ assert(sv); assert(mg) +PERL_CALLCONV int Perl_magic_freemglob(pTHX_ SV* sv, MAGIC* mg); +#define PERL_ARGS_ASSERT_MAGIC_FREEMGLOB \ + assert(sv); assert(mg) PERL_CALLCONV int Perl_magic_freeovrld(pTHX_ SV* sv, MAGIC* mg); #define PERL_ARGS_ASSERT_MAGIC_FREEOVRLD \ assert(sv); assert(mg) |