← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:04 2021

Filename/usr/local/lib/perl5/site_perl/B/Hooks/EndOfScope/XS.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sB::Hooks::EndOfScope::XS::::BEGIN@16B::Hooks::EndOfScope::XS::BEGIN@16
0000s0sB::Hooks::EndOfScope::XS::::BEGIN@18B::Hooks::EndOfScope::XS::BEGIN@18
0000s0sB::Hooks::EndOfScope::XS::::BEGIN@19B::Hooks::EndOfScope::XS::BEGIN@19
0000s0sB::Hooks::EndOfScope::XS::::BEGIN@4B::Hooks::EndOfScope::XS::BEGIN@4
0000s0sB::Hooks::EndOfScope::XS::::BEGIN@5B::Hooks::EndOfScope::XS::BEGIN@5
0000s0sB::Hooks::EndOfScope::XS::::__ANON__[:25]B::Hooks::EndOfScope::XS::__ANON__[:25]
0000s0sB::Hooks::EndOfScope::XS::::__ANON__[:26]B::Hooks::EndOfScope::XS::__ANON__[:26]
0000s0sB::Hooks::EndOfScope::XS::::on_scope_endB::Hooks::EndOfScope::XS::on_scope_end
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package B::Hooks::EndOfScope::XS;
2# ABSTRACT: Execute code after a scope finished compilation - XS implementation
3
4use strict;
5use warnings;
6
7our $VERSION = '0.24';
8
9# Limit the V::M-based (XS) version to perl 5.8.4+
10#
11# Given the unorthodox stuff we do to work around the hinthash double-free
12# might as well play it safe and only implement it in the PP version
13# and leave it at that
14# https://rt.perl.org/Public/Bug/Display.html?id=27040#txn-82797
15#
16use 5.008004;
17
18use Variable::Magic 0.48 ();
19use Sub::Exporter::Progressive 0.001006 -setup => {
20 exports => ['on_scope_end'],
21 groups => { default => ['on_scope_end'] },
22};
23
24my $wiz = Variable::Magic::wizard
25 data => sub { [$_[1]] },
26 free => sub { $_->() for @{ $_[1] }; () },
27 # When someone localise %^H, our magic doesn't want to be copied
28 # down. We want it to be around only for the scope we've initially
29 # attached ourselves to. Merely having MGf_LOCAL and a noop svt_local
30 # callback achieves this. If anything wants to attach more magic of our
31 # kind to a localised %^H, things will continue to just work as we'll be
32 # attached with a new and empty callback list.
33 local => \undef
34;
35
36sub on_scope_end (&) {
37 $^H |= 0x020000;
38
39 if (my $stack = Variable::Magic::getdata %^H, $wiz) {
40 push @{ $stack }, $_[0];
41 }
42 else {
43 Variable::Magic::cast %^H, $wiz, $_[0];
44 }
45}
46
471;
48
49__END__