| 1 | package Devel::SlowBless; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | require Carp; | |||||||||
| 6 | |||||||||||
| 7 | 1 | require Exporter; | |||||||||
| 8 | |||||||||||
| 9 | 1 | 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 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||
| 19 | amg_gen sub_gen | ||||||||||
| 20 | ) ] ); | ||||||||||
| 21 | |||||||||||
| 22 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||
| 23 | |||||||||||
| 24 | 1 | our @EXPORT = qw( | |||||||||
| 25 | |||||||||||
| 26 | ); | ||||||||||
| 27 | |||||||||||
| 28 | 1 | our $VERSION = '0.06'; | |||||||||
| 29 | |||||||||||
| 30 | 1 | require XSLoader; | |||||||||
| 31 | 1 | XSLoader::load('Devel::SlowBless', $VERSION); | |||||||||
| 32 | |||||||||||
| 33 | # Preloaded methods go here. | ||||||||||
| 34 | 1 | my $pid = 0; | |||||||||
| 35 | 1 | my $amg_gen = 0; | |||||||||
| 36 | 1 | my $sub_gen = 0; | |||||||||
| 37 | 1 | my $warn = 0; | |||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | sub start_warning { | ||||||||
|
Subroutine
start_warning: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 40 | 0 | $warn = 1; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 0 | ▶ | sub stop_warning { | ||||||||
|
Subroutine
stop_warning: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 44 | 0 | $warn = 0; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub DB::DB { | ||||||||
|
Subroutine
DB: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||
| 48 | 0 | my $cur_amg = amg_gen(); | |||||||||
| 49 | 0 | my $cur_sub = sub_gen(); | |||||||||
| 50 | |||||||||||
| 51 | 0 | ▶ | if ($pid != $$) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | { | ||||||||||
| 53 | 0 | $pid = $$; | |||||||||
| 54 | 0 | $amg_gen = $cur_amg; | |||||||||
| 55 | 0 | $sub_gen = $cur_sub; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 0 | ▶ | if ($amg_gen != $cur_amg) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | { | ||||||||||
| 60 | 0 | ▶ | if ($warn) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | { | ||||||||||
| 62 | 0 | Carp::cluck("[$pid] AMAGIC $amg_gen -> $cur_amg\n"); | |||||||||
| 63 | } | ||||||||||
| 64 | 0 | $amg_gen = $cur_amg; | |||||||||
| 65 | } | ||||||||||
| 66 | 0 | ▶ | if ($sub_gen != $cur_sub) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 67 | { | ||||||||||
| 68 | 0 | ▶ | if ($warn) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 1; | |||||||||
| 77 | __END__ | ||||||||||