This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add Perl_magic_freeutf8() magic vtable method
authorDavid Mitchell <davem@iabyn.com>
Mon, 19 Oct 2020 13:54:59 +0000 (14:54 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 23 Oct 2020 13:25:52 +0000 (14:25 +0100)
commit032a49194dbdca7f62038e1b4af134d72972ecd8
tree162fac0720de09a915c6bfc0b30f8c1039129240
parenta457b73cb378d9c4e10ffbacfc9a472be9395057
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.
embed.fnc
embed.h
mg.c
mg_vtable.h
proto.h
regen/mg_vtable.pl