summaryrefslogtreecommitdiff
path: root/proto.h
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 /proto.h
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 'proto.h')
-rw-r--r--proto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index f094fdbc1b..462c541179 100644
--- a/proto.h
+++ b/proto.h
@@ -1860,6 +1860,9 @@ PERL_CALLCONV int Perl_magic_freearylen_p(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_freeovrld(pTHX_ SV* sv, MAGIC* mg);
#define PERL_ARGS_ASSERT_MAGIC_FREEOVRLD \
assert(sv); assert(mg)
+PERL_CALLCONV int Perl_magic_freeutf8(pTHX_ SV* sv, MAGIC* mg);
+#define PERL_ARGS_ASSERT_MAGIC_FREEUTF8 \
+ assert(sv); assert(mg)
PERL_CALLCONV int Perl_magic_get(pTHX_ SV* sv, MAGIC* mg);
#define PERL_ARGS_ASSERT_MAGIC_GET \
assert(sv); assert(mg)