develooper Front page | perl.perl5.changes | Postings from October 2020

[Perl/perl5] a457b7: add Perl_magic_freecollxfrm() magic vtablemethod

From:
iabyn via perl5-changes
Date:
October 23, 2020 13:45
Subject:
[Perl/perl5] a457b7: add Perl_magic_freecollxfrm() magic vtablemethod
Message ID:
Perl/perl5/push/refs/heads/blead/b0441c-28df11@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a457b73cb378d9c4e10ffbacfc9a472be9395057
      https://github.com/Perl/perl5/commit/a457b73cb378d9c4e10ffbacfc9a472be9395057
  Author: David Mitchell <davem@iabyn.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M mg.c
    M mg_vtable.h
    M proto.h
    M regen/mg_vtable.pl

  Log Message:
  -----------
  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.


  Commit: 032a49194dbdca7f62038e1b4af134d72972ecd8
      https://github.com/Perl/perl5/commit/032a49194dbdca7f62038e1b4af134d72972ecd8
  Author: David Mitchell <davem@iabyn.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M mg.c
    M mg_vtable.h
    M proto.h
    M regen/mg_vtable.pl

  Log Message:
  -----------
  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.


  Commit: 02a48966c3f10e905b24f9bd307fa31c05060908
      https://github.com/Perl/perl5/commit/02a48966c3f10e905b24f9bd307fa31c05060908
  Author: David Mitchell <davem@iabyn.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M mg.c
    M mg_vtable.h
    M proto.h
    M regen/mg_vtable.pl

  Log Message:
  -----------
  add Perl_magic_freemglob() magic vtable method

S_mg_free_struct() has a workaround to never free mg->mg_ptr for
PERL_MAGIC_regex_global.

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_regex_global.

[ No, I don't know why PERL_MAGIC_regex_global's vtable and methods
  are suffixed mglob rather than regex_global or vice versa ]


  Commit: 28df11c0263c8ebd0e2bc0436b4a01c84279fc42
      https://github.com/Perl/perl5/commit/28df11c0263c8ebd0e2bc0436b4a01c84279fc42
  Author: David Mitchell <davem@iabyn.com>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M mg.c
    M mg_vtable.h
    M proto.h
    M regen/mg_vtable.pl

  Log Message:
  -----------
  [MERGE] don't do special-cases in S_mg_free_struct

Move all the special-case handling of various magic types out into
vtable->free() methods.


Compare: https://github.com/Perl/perl5/compare/b0441c5bc62a...28df11c0263c



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About