line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Array; |
2
|
31
|
|
|
31
|
|
138
|
use strict; |
|
31
|
|
|
|
|
286
|
|
|
31
|
|
|
|
|
702
|
|
3
|
31
|
|
|
31
|
|
141
|
use warnings; |
|
31
|
|
|
|
|
62
|
|
|
31
|
|
|
|
|
827
|
|
4
|
31
|
|
|
31
|
|
148
|
use base 'Tie::Array'; |
|
31
|
|
|
|
|
39
|
|
|
31
|
|
|
|
|
22424
|
|
5
|
31
|
|
|
31
|
|
71395
|
use Storable (); |
|
31
|
|
|
|
|
125209
|
|
|
31
|
|
|
|
|
10334
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# create new tied array |
8
|
|
|
|
|
|
|
sub TIEARRAY { |
9
|
54
|
|
|
54
|
|
460
|
my ($class, $share, $key) = @_; |
10
|
54
|
50
|
|
|
|
222
|
die "missing key" unless $key; |
11
|
54
|
|
|
|
|
333
|
my $self = bless { share => $share, key => $key }, $class; |
12
|
54
|
|
|
|
|
865
|
$self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _get { |
17
|
291
|
|
|
291
|
|
426
|
my $self = shift; |
18
|
291
|
|
|
|
|
1040
|
my $lock = $self->{share}->get_lock(); |
19
|
291
|
|
|
|
|
1023
|
return $self->{share}->get($self->{key}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
sub FETCH { |
22
|
270
|
|
|
270
|
|
3699
|
my ($self, $index) = @_; |
23
|
270
|
|
|
|
|
547
|
$self->_get()->[$index]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
sub FETCHSIZE { |
26
|
19
|
|
|
19
|
|
2201396
|
my $self = shift; |
27
|
19
|
|
|
|
|
112
|
my $ary = $self->_get(); |
28
|
19
|
|
|
|
|
186
|
scalar @$ary; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub STORESIZE { |
32
|
2
|
|
|
2
|
|
17
|
my ($self, $size) = @_; |
33
|
2
|
|
|
|
|
8
|
my $lock = $self->{share}->get_lock(); |
34
|
2
|
|
|
|
|
4
|
my $ary = $self->_get(); |
35
|
2
|
|
|
|
|
13
|
$#$ary = $size - 1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub STORE { |
39
|
242
|
|
|
242
|
|
1584
|
my ($self, $index, $val) = @_; |
40
|
|
|
|
|
|
|
|
41
|
242
|
|
|
|
|
1508
|
my $lock = $self->{share}->get_lock(); |
42
|
|
|
|
|
|
|
|
43
|
242
|
|
|
|
|
734
|
my $share = $self->{share}; |
44
|
242
|
|
|
|
|
1220
|
my $cur = $share->get($self->{key}); |
45
|
242
|
|
|
|
|
21890
|
$cur->[$index] = $val; |
46
|
242
|
|
|
|
|
1394
|
$share->set($self->{key} => $cur); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |