summaryrefslogtreecommitdiff
path: root/embed.fnc
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 /embed.fnc
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 'embed.fnc')
-rw-r--r--embed.fnc1
1 files changed, 1 insertions, 0 deletions
diff --git a/embed.fnc b/embed.fnc
index 96bea25dcc..56cd653109 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1329,6 +1329,7 @@ p |int |magic_settaint |NN SV* sv|NN MAGIC* mg
p |int |magic_setuvar |NN SV* sv|NN MAGIC* mg
p |int |magic_setvec |NN SV* sv|NN MAGIC* mg
p |int |magic_setutf8 |NN SV* sv|NN MAGIC* mg
+p |int |magic_freeutf8 |NN SV* sv|NN MAGIC* mg
p |int |magic_set_all_env|NN SV* sv|NN MAGIC* mg
p |U32 |magic_sizepack |NN SV* sv|NN MAGIC* mg
p |int |magic_wipepack |NN SV* sv|NN MAGIC* mg