summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2020-10-19 14:43:18 +0100
committerDavid Mitchell <davem@iabyn.com>2020-10-23 14:25:52 +0100
commita457b73cb378d9c4e10ffbacfc9a472be9395057 (patch)
tree62be5c2b4d8267303b222f39544417f62c55b27a /embed.fnc
parentb0441c5bc62aa2ba1980c5ae151db48af58bcfcf (diff)
downloadperl-a457b73cb378d9c4e10ffbacfc9a472be9395057.tar.gz
add Perl_magic_freecollxfrm() magic vtable method
v5.29.9-139-g44955e7de8 added a workaround to S_mg_free_struct() to free mg->mg_ptr in PERL_MAGIC_collxfrm 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_collxfrm.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc1
1 files changed, 1 insertions, 0 deletions
diff --git a/embed.fnc b/embed.fnc
index a68584dff9..96bea25dcc 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1338,6 +1338,7 @@ Fpod |SV* |magic_methcall |NN SV *sv|NN const MAGIC *mg \
Ap |I32 * |markstack_grow
#if defined(USE_LOCALE_COLLATE)
p |int |magic_setcollxfrm|NN SV* sv|NN MAGIC* mg
+p |int |magic_freecollxfrm|NN SV* sv|NN MAGIC* mg
pbD |char* |mem_collxfrm |NN const char* input_string|STRLEN len|NN STRLEN* xlen
: Defined in locale.c, used only in sv.c
# if defined(PERL_IN_LOCALE_C) || defined(PERL_IN_SV_C) || defined(PERL_IN_MATHOMS_C)