line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Array; |
2
|
31
|
|
|
31
|
|
125
|
use strict; |
|
31
|
|
|
|
|
236
|
|
|
31
|
|
|
|
|
1123
|
|
3
|
31
|
|
|
31
|
|
141
|
use warnings; |
|
31
|
|
|
|
|
26
|
|
|
31
|
|
|
|
|
725
|
|
4
|
31
|
|
|
31
|
|
119
|
use base 'Tie::Array'; |
|
31
|
|
|
|
|
35
|
|
|
31
|
|
|
|
|
16041
|
|
5
|
31
|
|
|
31
|
|
53923
|
use Storable (); |
|
31
|
|
|
|
|
91130
|
|
|
31
|
|
|
|
|
8184
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# create new tied array |
8
|
|
|
|
|
|
|
sub TIEARRAY { |
9
|
54
|
|
|
54
|
|
133
|
my ($class, $share, $key) = @_; |
10
|
54
|
50
|
|
|
|
134
|
die "missing key" unless $key; |
11
|
54
|
|
|
|
|
300
|
my $self = bless { share => $share, key => $key }, $class; |
12
|
54
|
|
|
|
|
530
|
$self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _get { |
17
|
291
|
|
|
291
|
|
275
|
my $self = shift; |
18
|
291
|
|
|
|
|
676
|
my $lock = $self->{share}->get_lock(); |
19
|
291
|
|
|
|
|
715
|
return $self->{share}->get($self->{key}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
sub FETCH { |
22
|
270
|
|
|
270
|
|
2584
|
my ($self, $index) = @_; |
23
|
270
|
|
|
|
|
369
|
$self->_get()->[$index]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
sub FETCHSIZE { |
26
|
19
|
|
|
19
|
|
447224
|
my $self = shift; |
27
|
19
|
|
|
|
|
87
|
my $ary = $self->_get(); |
28
|
19
|
|
|
|
|
122
|
scalar @$ary; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub STORESIZE { |
32
|
2
|
|
|
2
|
|
12
|
my ($self, $size) = @_; |
33
|
2
|
|
|
|
|
5
|
my $lock = $self->{share}->get_lock(); |
34
|
2
|
|
|
|
|
3
|
my $ary = $self->_get(); |
35
|
2
|
|
|
|
|
10
|
$#$ary = $size - 1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub STORE { |
39
|
242
|
|
|
242
|
|
586
|
my ($self, $index, $val) = @_; |
40
|
|
|
|
|
|
|
|
41
|
242
|
|
|
|
|
911
|
my $lock = $self->{share}->get_lock(); |
42
|
|
|
|
|
|
|
|
43
|
242
|
|
|
|
|
434
|
my $share = $self->{share}; |
44
|
242
|
|
|
|
|
711
|
my $cur = $share->get($self->{key}); |
45
|
242
|
|
|
|
|
13737
|
$cur->[$index] = $val; |
46
|
242
|
|
|
|
|
923
|
$share->set($self->{key} => $cur); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |