summaryrefslogtreecommitdiff
path: root/regen/mg_vtable.pl
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2020-10-19 14:54:59 +0100
committerDavid Mitchell <davem@iabyn.com>2020-10-23 14:25:52 +0100
commit032a49194dbdca7f62038e1b4af134d72972ecd8 (patch)
tree162fac0720de09a915c6bfc0b30f8c1039129240 /regen/mg_vtable.pl
parenta457b73cb378d9c4e10ffbacfc9a472be9395057 (diff)
downloadperl-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 'regen/mg_vtable.pl')
-rw-r--r--regen/mg_vtable.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
index 5a102cc2c4..ae712b7ddf 100644
--- a/regen/mg_vtable.pl
+++ b/regen/mg_vtable.pl
@@ -274,7 +274,8 @@ my %sig =
'regdatum' => {get => 'regdatum_get', set => 'regdatum_set'},
'backref' => {free => 'killbackrefs'},
'ovrld' => {free => 'freeovrld'},
- 'utf8' => {set => 'setutf8'},
+ 'utf8' => {set => 'setutf8',
+ free => 'freeutf8' },
'collxfrm' => {set => 'setcollxfrm',
free => 'freecollxfrm',
cond => '#ifdef USE_LOCALE_COLLATE'},