diff options
author | David Mitchell <davem@iabyn.com> | 2020-10-19 14:54:59 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2020-10-23 14:25:52 +0100 |
commit | 032a49194dbdca7f62038e1b4af134d72972ecd8 (patch) | |
tree | 162fac0720de09a915c6bfc0b30f8c1039129240 /mg_vtable.h | |
parent | a457b73cb378d9c4e10ffbacfc9a472be9395057 (diff) | |
download | perl-032a49194dbdca7f62038e1b4af134d72972ecd8.tar.gz |
add Perl_magic_freeutf8() magic vtable method
S_mg_free_struct() has a workaround to free mg->mg_ptr in
PERL_MAGIC_utf8 even if mg_len is zero.
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_utf8.
Diffstat (limited to 'mg_vtable.h')
-rw-r--r-- | mg_vtable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mg_vtable.h b/mg_vtable.h index 809ab0e236..8815d697ca 100644 --- a/mg_vtable.h +++ b/mg_vtable.h @@ -190,7 +190,7 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = { { Perl_magic_getsubstr, Perl_magic_setsubstr, 0, 0, 0, 0, 0, 0 }, { Perl_magic_get, Perl_magic_set, 0, 0, 0, 0, 0, 0 }, { Perl_magic_gettaint, Perl_magic_settaint, 0, 0, 0, 0, 0, 0 }, - { 0, Perl_magic_setutf8, 0, 0, 0, 0, 0, 0 }, + { 0, Perl_magic_setutf8, 0, 0, Perl_magic_freeutf8, 0, 0, 0 }, { Perl_magic_getuvar, Perl_magic_setuvar, 0, 0, 0, 0, 0, 0 }, { Perl_magic_getvec, Perl_magic_setvec, 0, 0, 0, 0, 0, 0 } }; |