Front page | perl.perl5.changes |
Postings from March 2023
[Perl/perl5] 5753ce: t/lib/GH_15109 - rename to t/lib/caller
From:
Yves Orton via perl5-changes
Date:
March 18, 2023 12:58
Subject:
[Perl/perl5] 5753ce: t/lib/GH_15109 - rename to t/lib/caller
Message ID:
Perl/perl5/push/refs/heads/blead/518846-93f6f9@github.com
Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: 5753ce0b56169a13e14034a26daefe8eafe8d614
https://github.com/Perl/perl5/commit/5753ce0b56169a13e14034a26daefe8eafe8d614
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M MANIFEST
R t/lib/GH_15109/Apack.pm
R t/lib/GH_15109/Bpack.pm
R t/lib/GH_15109/Cpack.pm
R t/lib/GH_15109/Foo.pm
A t/lib/caller/Apack.pm
A t/lib/caller/Bpack.pm
A t/lib/caller/Cpack.pm
A t/lib/caller/Foo.pm
M t/op/caller.t
Log Message:
-----------
t/lib/GH_15109 - rename to t/lib/caller
I want to use these modules in other tests, so changing the name
makes sense.
Commit: e2e830cd93e16aedc6c6225069eeb7bdfc431a43
https://github.com/Perl/perl5/commit/e2e830cd93e16aedc6c6225069eeb7bdfc431a43
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M regen/mg_vtable.pl
Log Message:
-----------
regen/mg_vtable.pl - rename confusing var %sig to %vtable_conf
Commit: 6dd040ff2f6f01a817731d112756188ddb541a18
https://github.com/Perl/perl5/commit/6dd040ff2f6f01a817731d112756188ddb541a18
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M embed.fnc
M embed.h
M proto.h
M sv.h
M sv_inline.h
Log Message:
-----------
sv.h - add SvREFCNT_dec_set_NULL()
and also SvREFCNT_dec_ret_NULL() which is used to implement
SvREFCNT_dec_set_NULL(). The set_NULL() macro is intended to
be used to replace code like this:
if (sv) {
SvREFCNT_dec_NN(sv);
sv = NULL;
}
The function form just facilitates it, and can be used in situations
where returning NULL after decrementing a refcount would be reduce
code complexity.
Commit: c5e777577e67bd04dabd02ea5f0419d64db968e8
https://github.com/Perl/perl5/commit/c5e777577e67bd04dabd02ea5f0419d64db968e8
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M pod/perldiag.pod
Log Message:
-----------
pod/perldiag.pod - provide full path to issues tracker
https://github.com/Perl/perl5/issues shows the list of open issues,
whereas https://github.com/Perl/perl5/issues/new/choose is where someone
can create a new ticket.
Commit: 98f6c100d916f65d489eb1ef4fb8aa60825a736c
https://github.com/Perl/perl5/commit/98f6c100d916f65d489eb1ef4fb8aa60825a736c
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M dist/threads-shared/lib/threads/shared.pm
M dist/threads-shared/shared.xs
Log Message:
-----------
threads-shared - fixup typo in comment
Commit: 2f920c2f73ae58b754ccf1d897f1104e0cc3a4c6
https://github.com/Perl/perl5/commit/2f920c2f73ae58b754ccf1d897f1104e0cc3a4c6
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M ext/XS-APItest/APItest.pm
M ext/XS-APItest/APItest.xs
A ext/XS-APItest/t/mortal_destructor.t
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M pod/perldiag.pod
M pod/perlguts.pod
M proto.h
M regen/mg_vtable.pl
M scope.c
M scope.h
Log Message:
-----------
scope.c - add mortal_destructor_sv() and mortal_svfunc_x()
The function SAVEDESTRUCTOR_X() (save_destructor_x) can be used to
execute a C function at the end of the current psuedo-block. Prior to
this patch there was no "mortal" equivalent that would execute at the
end of the current statement. We offer a collection of functions which
are intended to free SV's at either point in time, but only support
callbacks at the end of the current pseudo-block.
This patch adds two such functions, "mortal_destructor_sv" which can be
used to trigger a perl code reference to execute at the end of the
current statement, and "mortal_svfunc_x" which can be used to trigger an
SVFUNC_t C function at the end of the current statement.
Both functions differ from save_destructor_x() in that instead of
supporting a void pointer argument they both require their argument to
be some sort of SV pointer. The Perl callback function triggered by
"mortal_destructor_sv" may be provided no arguments, a single argument
or a list of arguments, depending on the type of argument provided to
mortal_destructor_sv(): when the argument is a raw AV (with no SV ref
wrapping it), then the contents of the AV are passed in as a list of
arguments. When the argument is anything else but NULL, the argument is
provided as a single argument, and when it is NULL the perl function is
called with no arguments.
Both functions are implemented on top of a mortal SV (unseen by the
user) which has PERL_MAGIC_destruct magic associated with it, which
triggers the destructor behavior when the SV is freed.
Both functions are provided with macros to match the normal SAVExx()
API, with MORTALDESTRUCTOR_SV() wrapping mortal_destructor_sv() and
MORTALSVFUNC_X() wrapping mortal_svfunc_x().
The heart of this logic cribbed from Leon Timmermans' Variable-OnDestruct.
See the code at:
https://metacpan.org/dist/Variable-OnDestruct/source/lib/Variable/OnDestruct.xs#L6-17
I am very grateful to him for his help on this. Any errors or omissions
in this code are my fault, not his.
Commit: 93f6f9654a81b66c47c07ca982e4c00558bd4159
https://github.com/Perl/perl5/commit/93f6f9654a81b66c47c07ca982e4c00558bd4159
Author: Yves Orton <demerphq@gmail.com>
Date: 2023-03-18 (Sat, 18 Mar 2023)
Changed paths:
M MANIFEST
M embed.fnc
M embed.h
M embedvar.h
M gv.c
M intrpvar.h
M mg.c
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M perl.c
M pod/perldiag.pod
M pod/perlfunc.pod
M pod/perlguts.pod
M pod/perlvar.pod
M pp_ctl.c
M proto.h
M regen/mg_vtable.pl
M sv.c
M t/harness
A t/lib/caller/Bicycle.pm
A t/lib/caller/Cycle.pm
A t/lib/caller/Tricycle.pm
M t/op/glob.t
A t/op/hook/require.t
Log Message:
-----------
pp_ctl.c - add support for hooking require.
This defines a new magic hash C<%{^HOOK}> which is intended to be used for
hooking keywords. It is similar to %SIG in that the values it contains
are validated on set, and it is not allowed to store something in
C<%{^HOOK}> that isn't supposed to be there. Hooks are expected to be
coderefs (people can use currying if they really want to put an object
in there, the API is deliberately simple.)
The C<%{^HOOK}> hash is documented to have keys of the form
"${keyword}__${phase}" where $phase is either "before" or "after"
and in this initial release two hooks are supported,
"require__before" and "require__after":
The C<require__before> hook is called before require is executed,
including any @INC hooks that might be fired. It is called with the path
of the file being required, just as would be stored in %INC. The hook
may alter the filename by writing to $_[0] and it may return a coderef
to be executed *after* the require has completed, otherwise the return
is ignored. This coderef is also called with the path of the file which
was required, and it will be called regardless as to whether the require
(or its dependencies) die during execution. This mechanism makes it
trivial and safe to share state between the initial hook and the coderef
it returns.
The C<require__after> hook is similar to the C<require__before> hook
however except that it is called after the require completes
(successfully or not), and its return is ignored always.
Compare: https://github.com/Perl/perl5/compare/518846582427...93f6f9654a81
-
[Perl/perl5] 5753ce: t/lib/GH_15109 - rename to t/lib/caller
by Yves Orton via perl5-changes