summaryrefslogtreecommitdiff
path: root/proto.h
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 /proto.h
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 'proto.h')
-rw-r--r--proto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 2da1a07761..f094fdbc1b 100644
--- a/proto.h
+++ b/proto.h
@@ -6780,6 +6780,9 @@ PERL_CALLCONV bool Perl__is_cur_LC_category_utf8(pTHX_ int category);
#define PERL_ARGS_ASSERT__IS_CUR_LC_CATEGORY_UTF8
#endif
#if defined(USE_LOCALE_COLLATE)
+PERL_CALLCONV int Perl_magic_freecollxfrm(pTHX_ SV* sv, MAGIC* mg);
+#define PERL_ARGS_ASSERT_MAGIC_FREECOLLXFRM \
+ assert(sv); assert(mg)
PERL_CALLCONV int Perl_magic_setcollxfrm(pTHX_ SV* sv, MAGIC* mg);
#define PERL_ARGS_ASSERT_MAGIC_SETCOLLXFRM \
assert(sv); assert(mg)