blib/lib/Ref/Store/ThreadUtil.pm

filter: Statementstmt 69.2% 36 / 52 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 68.7% 11 / 16 Podpod 0.0% 0 / 4 totaltotal 65.2% 47 / 72 CC 2 SCAR 6.0
CC
2
Cov
69%
new
6.0
hr_thrutil_store_linfo
2.0
hr_thrutil_get_linfo
2.0
CRAP 1.8
« blib/lib/Ref/Store/Feature/KeyTyped.pm ↑ Summary blib/lib/Ref/Store/XS.pm »
1 package Ref::Store::ThreadUtil::OldLookups;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Ref::Store::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 my @Lookups;
7 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 @Lookups = qw(forward reverse attr_lookup scalar_lookup);
9 }
10 use Class::XSAccessor::Array
11 2 ▶ accessors => { %Ref::Store::Common::LookupNames };
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
14 0 my ($cls,$old_table) = @_;
15 0 my %options = ();
16 0 my $self = [];
17 0 foreach my $idx (
18 HR_TIDX_RLOOKUP, HR_TIDX_FLOOKUP,
19 HR_TIDX_ALOOKUP, HR_TIDX_SLOOKUP) {
20 0 $self->[$idx] = { %{$old_table->[$idx]} };
21 }
22 0 bless $self, $cls;
23 }
24  
25 package Ref::Store::ThreadUtil;
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 our @EXPORT;
30 2 ▶use constant HR_THR_AENCAP_PREFIX => '__PP_AENCAP:';
Subroutine BEGIN: called CC=1 SCAR=0.0
31 2 ▶use constant HR_THR_KENCAP_PREFIX => '__PP_KENCAP:';
Subroutine BEGIN: called CC=1 SCAR=0.0
32 2 ▶use constant HR_THR_LINFO_PREFIX => '__PP_OLD_LOOKUPS:';
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 2 push @EXPORT, qw(
35 HR_THR_AENCAP_PREFIX
36 HR_THR_KENCAP_PREFIX
37 HR_THR_LINFO_PREFIX
38 );
39  
40 0 ▶sub hr_thrutil_store_linfo {
Subroutine hr_thrutil_store_linfo: not called CC=1 SCAR=6.9
Pod undocumented
41 0 my ($old_table,$ptr_map) = @_;
42 0 my $linfo = Ref::Store::ThreadUtil::OldLookups->new($old_table);
43 0 $ptr_map->{ HR_THR_LINFO_PREFIX . ($old_table + 0) } = $linfo;
44 }
45  
46 0 ▶sub hr_thrutil_get_linfo {
Subroutine hr_thrutil_get_linfo: not called CC=1 SCAR=6.9
Pod undocumented
47 0 my ($old_taddr,$ptr_map) = @_;
48 0 return $ptr_map->{ HR_THR_LINFO_PREFIX . $old_taddr };
49 }
50  
51 2 push @EXPORT, qw(hr_thrutil_store_linfo hr_thrutil_get_linfo);
52  
53 0 ▶sub hr_thrutil_store_kinfo {
Subroutine hr_thrutil_store_kinfo: not called CC=1 SCAR=6.9
Pod undocumented
54 0 my ($prefix,$k,$ptr_map,$info) = @_;
55 0 $ptr_map->{$prefix . $k} = $info;
56 }
57  
58 0 ▶sub hr_thrutil_get_kinfo {
Subroutine hr_thrutil_get_kinfo: not called CC=1 SCAR=6.9
Pod undocumented
59 0 my ($prefix,$k,$ptr_map) = @_;
60 0 $ptr_map->{$prefix.$k};
61 }
62  
63 2 push @EXPORT, qw(hr_thrutil_store_kinfo hr_thrutil_get_kinfo);
64  
« blib/lib/Ref/Store/Feature/KeyTyped.pm ↑ Summary blib/lib/Ref/Store/XS.pm »