line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::SlowBless; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20983
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
363
|
|
5
|
|
|
|
|
|
|
require Carp; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
12
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
13
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# This allows declaration use Devel::SlowBless ':all'; |
16
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
17
|
|
|
|
|
|
|
# will save memory. |
18
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
19
|
|
|
|
|
|
|
amg_gen sub_gen |
20
|
|
|
|
|
|
|
) ] ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our @EXPORT = qw( |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
require XSLoader; |
31
|
|
|
|
|
|
|
XSLoader::load('Devel::SlowBless', $VERSION); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Preloaded methods go here. |
34
|
|
|
|
|
|
|
my $pid = 0; |
35
|
|
|
|
|
|
|
my $amg_gen = 0; |
36
|
|
|
|
|
|
|
my $sub_gen = 0; |
37
|
|
|
|
|
|
|
my $warn = 0; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub start_warning { |
40
|
0
|
|
|
0
|
0
|
|
$warn = 1; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub stop_warning { |
44
|
0
|
|
|
0
|
0
|
|
$warn = 0; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub DB::DB { |
48
|
0
|
|
|
0
|
0
|
|
my $cur_amg = amg_gen(); |
49
|
0
|
|
|
|
|
|
my $cur_sub = sub_gen(); |
50
|
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
if ($pid != $$) |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
$pid = $$; |
54
|
0
|
|
|
|
|
|
$amg_gen = $cur_amg; |
55
|
0
|
|
|
|
|
|
$sub_gen = $cur_sub; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
if ($amg_gen != $cur_amg) |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
0
|
|
|
|
|
if ($warn) |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
|
|
|
Carp::cluck("[$pid] AMAGIC $amg_gen -> $cur_amg\n"); |
63
|
|
|
|
|
|
|
} |
64
|
0
|
|
|
|
|
|
$amg_gen = $cur_amg; |
65
|
|
|
|
|
|
|
} |
66
|
0
|
0
|
|
|
|
|
if ($sub_gen != $cur_sub) |
67
|
|
|
|
|
|
|
{ |
68
|
0
|
0
|
|
|
|
|
if ($warn) |
69
|
|
|
|
|
|
|
{ |
70
|
0
|
|
|
|
|
|
Carp::cluck("[$pid] SUB GEN $sub_gen - $cur_sub\n"); |
71
|
|
|
|
|
|
|
} |
72
|
0
|
|
|
|
|
|
$sub_gen = $cur_sub; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
__END__ |