line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::SharedFork::Array; |
2
|
31
|
|
|
31
|
|
155
|
use strict; |
|
31
|
|
|
|
|
276
|
|
|
31
|
|
|
|
|
791
|
|
3
|
31
|
|
|
31
|
|
153
|
use warnings; |
|
31
|
|
|
|
|
67
|
|
|
31
|
|
|
|
|
793
|
|
4
|
31
|
|
|
31
|
|
153
|
use base 'Tie::Array'; |
|
31
|
|
|
|
|
47
|
|
|
31
|
|
|
|
|
154061
|
|
5
|
31
|
|
|
31
|
|
533575
|
use Storable (); |
|
31
|
|
|
|
|
891855
|
|
|
31
|
|
|
|
|
10583
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# create new tied array |
8
|
|
|
|
|
|
|
sub TIEARRAY { |
9
|
54
|
|
|
54
|
|
535
|
my ($class, $share, $key) = @_; |
10
|
54
|
50
|
|
|
|
182
|
die "missing key" unless $key; |
11
|
54
|
|
|
|
|
339
|
my $self = bless { share => $share, key => $key }, $class; |
12
|
54
|
|
|
|
|
742
|
$self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _get { |
17
|
291
|
|
|
291
|
|
412
|
my $self = shift; |
18
|
291
|
|
|
|
|
986
|
my $lock = $self->{share}->get_lock(); |
19
|
291
|
|
|
|
|
994
|
return $self->{share}->get($self->{key}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
sub FETCH { |
22
|
270
|
|
|
270
|
|
3504
|
my ($self, $index) = @_; |
23
|
270
|
|
|
|
|
551
|
$self->_get()->[$index]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
sub FETCHSIZE { |
26
|
19
|
|
|
19
|
|
561666
|
my $self = shift; |
27
|
19
|
|
|
|
|
125
|
my $ary = $self->_get(); |
28
|
19
|
|
|
|
|
187
|
scalar @$ary; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub STORESIZE { |
32
|
2
|
|
|
2
|
|
19
|
my ($self, $size) = @_; |
33
|
2
|
|
|
|
|
9
|
my $lock = $self->{share}->get_lock(); |
34
|
2
|
|
|
|
|
7
|
my $ary = $self->_get(); |
35
|
2
|
|
|
|
|
18
|
$#$ary = $size - 1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub STORE { |
39
|
242
|
|
|
242
|
|
1065
|
my ($self, $index, $val) = @_; |
40
|
|
|
|
|
|
|
|
41
|
242
|
|
|
|
|
1341
|
my $lock = $self->{share}->get_lock(); |
42
|
|
|
|
|
|
|
|
43
|
242
|
|
|
|
|
658
|
my $share = $self->{share}; |
44
|
242
|
|
|
|
|
1012
|
my $cur = $share->get($self->{key}); |
45
|
242
|
|
|
|
|
19133
|
$cur->[$index] = $val; |
46
|
242
|
|
|
|
|
1249
|
$share->set($self->{key} => $cur); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |