File Coverage

blib/lib/Linux/Statm/Tiny.pm.mite.pm
Criterion Covered Total %
statement 294 440 66.8
branch 114 278 41.0
condition 27 204 13.2
subroutine 72 84 85.7
pod 2 20 10.0
total 509 1026 49.6


line stmt bran cond sub pod time code
1             {
2             package Linux::Statm::Tiny;
3             our $USES_MITE = q[Mite::Class];
4 3     3   16 use strict;
  3         4  
  3         64  
5 3     3   11 use warnings;
  3         5  
  3         1414  
6              
7              
8             sub new {
9 3 50   3 0 4850 my $class = ref($_[0]) ? ref(shift) : shift;
10 3   33     46 my $meta = ( $Mite::META{$class} ||= $class->__META__ );
11 3         13 my $self = bless {}, $class;
12 3 50       18 my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ };
  0 50       0  
13 3         12 my $no_build = delete $args->{__no_BUILD__};
14              
15             # Initialize attributes
16 3 0 0     11 if ( exists($args->{q[pid]}) ) { (do { my $tmp = $args->{q[pid]}; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or require Carp && Carp::croak(q[Type check failed in constructor: pid should be Int]); $self->{q[pid]} = $args->{q[pid]}; }
  0 0 0     0  
  0 50       0  
  0         0  
  0         0  
17              
18             # Enforce strict constructor
19 3 0 0     6 my @unknown = grep not( do { package Linux::Statm::Tiny::Mite; (defined and !ref and m{\A(?:(?:d(?:ata_pages|t_pages)|lib_pages|pid|r(?:esident_pages|ss(?:_(?:bytes|kb|mb|pages))?)|s(?:hare_pages|ize_pages)|text_pages|vsz(?:_(?:bytes|kb|mb|pages))?))\z}) } ), keys %{$args}; @unknown and require Carp and Carp::croak("Unexpected keys in constructor: " . join(q[, ], sort @unknown));
  0 50 33     0  
  3         10  
  3         11  
20              
21             # Call BUILD methods
22 3 50       8 unless ( $no_build ) { $_->($self, $args) for @{ $meta->{BUILD} || [] } };
  3 50       6  
  3         10  
23              
24 3         25 return $self;
25             }
26              
27             defined ${^GLOBAL_PHASE}
28             or eval { require Devel::GlobalDestruction; 1 }
29             or do { *Devel::GlobalDestruction::in_global_destruction = sub { undef; } };
30              
31             sub DESTROY {
32 3     3   2012 my $self = shift;
33 3   33     43 my $class = ref( $self ) || $self;
34 3   33     49 my $meta = ( $Mite::META{$class} ||= $class->__META__ );
35 3 50       48 my $in_global_destruction = defined ${^GLOBAL_PHASE}
36             ? ${^GLOBAL_PHASE} eq 'DESTRUCT'
37             : Devel::GlobalDestruction::in_global_destruction();
38 3 50       12 for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) {
  3         32  
39 0         0 my $e = do {
40 0         0 local ( $?, $@ );
41 0         0 eval { $demolisher->( $self, $in_global_destruction ) };
  0         0  
42 0         0 $@;
43             };
44 3     3   16 no warnings 'misc'; # avoid (in cleanup) warnings
  3         6  
  3         210  
45 0 0       0 die $e if $e; # rethrow
46             }
47 3         697 return;
48             }
49              
50             sub __META__ {
51 3     3   16 no strict 'refs';
  3         5  
  3         15775  
52 3     3   26 require mro;
53 3   33     12 my $class = shift; $class = ref($class) || $class;
  3         23  
54 3         16 my $linear_isa = mro::get_linear_isa( $class );
55             return {
56             BUILD => [
57 3 50       7 map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
  3         37  
  0         0  
58 3         22 map { "$_\::BUILD" } reverse @$linear_isa
59             ],
60             DEMOLISH => [
61 3 50       13 map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
  3         119  
  0         0  
62 3         21 map { "$_\::DEMOLISH" } @$linear_isa
  3         14  
63             ],
64             HAS_BUILDARGS => $class->can('BUILDARGS'),
65             };
66             }
67              
68             sub DOES {
69 0     0 0 0 my ( $self, $role ) = @_;
70 0         0 our %DOES;
71 0 0       0 return $DOES{$role} if exists $DOES{$role};
72 0 0       0 return 1 if $role eq __PACKAGE__;
73 0         0 return $self->SUPER::DOES( $role );
74             }
75              
76             sub does {
77 0     0 0 0 shift->DOES( @_ );
78             }
79              
80             my $__XS = !$ENV{MITE_PURE_PERL} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };
81              
82             # Accessors for data
83 1     1   2 *_refresh_data = sub { delete $_[0]->{q[data]}; $_[0]; };
  1         2  
84 24 50 0 24   1551 *data = sub { @_ > 1 ? require Carp && Carp::croak("data is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[data]}) ? $_[0]{q[data]} : ( $_[0]{q[data]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__data_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: data should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 100       5  
  2 50       13  
  2         6  
  2         4  
  2         32  
  0         0  
  0         0  
  2         13  
85              
86             # Aliases for for data
87 4     4 0 15 sub data_pages { shift->data( @_ ) }
88              
89             # Accessors for data_bytes
90 1     1   3 *_refresh_data_bytes = sub { delete $_[0]->{q[data_bytes]}; $_[0]; };
  1         2  
91 2 50 0 2   13 *data_bytes = sub { @_ > 1 ? require Carp && Carp::croak("data_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[data_bytes]}) ? $_[0]{q[data_bytes]} : ( $_[0]{q[data_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__data_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: data_bytes should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 50       3  
  2 50       8  
  2         5  
  2         4  
  2         40  
  0         0  
  0         0  
  2         11  
92              
93             # Accessors for data_kb
94 1     1   2 *_refresh_data_kb = sub { delete $_[0]->{q[data_kb]}; $_[0]; };
  1         9  
95 2 50 0 2   17 *data_kb = sub { @_ > 1 ? require Carp && Carp::croak("data_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[data_kb]}) ? $_[0]{q[data_kb]} : ( $_[0]{q[data_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__data_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: data_kb should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 50       4  
  2 50       7  
  2         4  
  2         5  
  2         38  
  0         0  
  0         0  
  2         12  
96              
97             # Accessors for data_mb
98 1     1   2 *_refresh_data_mb = sub { delete $_[0]->{q[data_mb]}; $_[0]; };
  1         2  
99 2 50 0 2   13 *data_mb = sub { @_ > 1 ? require Carp && Carp::croak("data_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[data_mb]}) ? $_[0]{q[data_mb]} : ( $_[0]{q[data_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__data_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: data_mb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 50       5  
  2 50       7  
  2         4  
  2         5  
  2         39  
  0         0  
  0         0  
  2         13  
100              
101             # Accessors for dt
102 1     1   2 *_refresh_dt = sub { delete $_[0]->{q[dt]}; $_[0]; };
  1         3  
103 0 0 0 0   0 *dt = sub { @_ > 1 ? require Carp && Carp::croak("dt is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[dt]}) ? $_[0]{q[dt]} : ( $_[0]{q[dt]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__dt_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: dt should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
104              
105             # Aliases for for dt
106 0     0 0 0 sub dt_pages { shift->dt( @_ ) }
107              
108             # Accessors for dt_bytes
109 1     1   2 *_refresh_dt_bytes = sub { delete $_[0]->{q[dt_bytes]}; $_[0]; };
  1         2  
110 0 0 0 0   0 *dt_bytes = sub { @_ > 1 ? require Carp && Carp::croak("dt_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[dt_bytes]}) ? $_[0]{q[dt_bytes]} : ( $_[0]{q[dt_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__dt_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: dt_bytes should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
111              
112             # Accessors for dt_kb
113 1     1   2 *_refresh_dt_kb = sub { delete $_[0]->{q[dt_kb]}; $_[0]; };
  1         2  
114 0 0 0 0   0 *dt_kb = sub { @_ > 1 ? require Carp && Carp::croak("dt_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[dt_kb]}) ? $_[0]{q[dt_kb]} : ( $_[0]{q[dt_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__dt_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: dt_kb should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
115              
116             # Accessors for dt_mb
117 1     1   4 *_refresh_dt_mb = sub { delete $_[0]->{q[dt_mb]}; $_[0]; };
  1         3  
118 0 0 0 0   0 *dt_mb = sub { @_ > 1 ? require Carp && Carp::croak("dt_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[dt_mb]}) ? $_[0]{q[dt_mb]} : ( $_[0]{q[dt_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__dt_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: dt_mb should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
119              
120             # Accessors for lib
121 1     1   2 *_refresh_lib = sub { delete $_[0]->{q[lib]}; $_[0]; };
  1         2  
122 0 0 0 0   0 *lib = sub { @_ > 1 ? require Carp && Carp::croak("lib is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[lib]}) ? $_[0]{q[lib]} : ( $_[0]{q[lib]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__lib_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: lib should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
123              
124             # Aliases for for lib
125 0     0 0 0 sub lib_pages { shift->lib( @_ ) }
126              
127             # Accessors for lib_bytes
128 1     1   2 *_refresh_lib_bytes = sub { delete $_[0]->{q[lib_bytes]}; $_[0]; };
  1         2  
129 0 0 0 0   0 *lib_bytes = sub { @_ > 1 ? require Carp && Carp::croak("lib_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[lib_bytes]}) ? $_[0]{q[lib_bytes]} : ( $_[0]{q[lib_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__lib_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: lib_bytes should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
130              
131             # Accessors for lib_kb
132 1     1   2 *_refresh_lib_kb = sub { delete $_[0]->{q[lib_kb]}; $_[0]; };
  1         3  
133 0 0 0 0   0 *lib_kb = sub { @_ > 1 ? require Carp && Carp::croak("lib_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[lib_kb]}) ? $_[0]{q[lib_kb]} : ( $_[0]{q[lib_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__lib_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: lib_kb should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
134              
135             # Accessors for lib_mb
136 1     1   3 *_refresh_lib_mb = sub { delete $_[0]->{q[lib_mb]}; $_[0]; };
  1         3  
137 0 0 0 0   0 *lib_mb = sub { @_ > 1 ? require Carp && Carp::croak("lib_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[lib_mb]}) ? $_[0]{q[lib_mb]} : ( $_[0]{q[lib_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__lib_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: lib_mb should be Int]) }; $default_value } ) ) };
  0 0 0     0  
  0 0       0  
  0 0       0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
  0         0  
138              
139             # Accessors for pid
140 3 50 0 3   59 *pid = sub { @_ > 1 ? require Carp && Carp::croak("pid is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[pid]}) ? $_[0]{q[pid]} : ( $_[0]{q[pid]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__pid_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: pid should be Int]) }; $default_value } ) ) };
  2 50 33     31  
  2 100       13  
  2 50       30  
  2         14  
  2         10  
  2         131  
  0         0  
  0         0  
  2         31  
141              
142             # Accessors for resident
143 1     1   2 *_refresh_resident = sub { delete $_[0]->{q[resident]}; $_[0]; };
  1         2  
144 46 50 0 46   1611 *resident = sub { @_ > 1 ? require Carp && Carp::croak("resident is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[resident]}) ? $_[0]{q[resident]} : ( $_[0]{q[resident]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__resident_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: resident should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 100       4  
  2 50       9  
  2         4  
  2         5  
  2         31  
  0         0  
  0         0  
  2         11  
145              
146             # Aliases for for resident
147 4     4 0 14 sub resident_pages { shift->resident( @_ ) }
148 16     16 1 1400 sub rss { shift->resident( @_ ) }
149 4     4 0 12 sub rss_pages { shift->resident( @_ ) }
150              
151             # Accessors for resident_bytes
152 1     1   2 *_refresh_resident_bytes = sub { delete $_[0]->{q[resident_bytes]}; $_[0]; };
  1         2  
153 4 50 0 4   65 *resident_bytes = sub { @_ > 1 ? require Carp && Carp::croak("resident_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[resident_bytes]}) ? $_[0]{q[resident_bytes]} : ( $_[0]{q[resident_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__resident_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: resident_bytes should be Int]) }; $default_value } ) ) };
  2 50 33     36  
  2 100       6  
  2 50       9  
  2         5  
  2         3  
  2         46  
  0         0  
  0         0  
  2         13  
154              
155             # Aliases for for resident_bytes
156 2     2 0 8 sub rss_bytes { shift->resident_bytes( @_ ) }
157              
158             # Accessors for resident_kb
159 1     1   3 *_refresh_resident_kb = sub { delete $_[0]->{q[resident_kb]}; $_[0]; };
  1         1  
160 4 50 0 4   24 *resident_kb = sub { @_ > 1 ? require Carp && Carp::croak("resident_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[resident_kb]}) ? $_[0]{q[resident_kb]} : ( $_[0]{q[resident_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__resident_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: resident_kb should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 100       4  
  2 50       7  
  2         4  
  2         4  
  2         40  
  0         0  
  0         0  
  2         13  
161              
162             # Aliases for for resident_kb
163 2     2 0 9 sub rss_kb { shift->resident_kb( @_ ) }
164              
165             # Accessors for resident_mb
166 1     1   2 *_refresh_resident_mb = sub { delete $_[0]->{q[resident_mb]}; $_[0]; };
  1         3  
167 4 50 0 4   23 *resident_mb = sub { @_ > 1 ? require Carp && Carp::croak("resident_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[resident_mb]}) ? $_[0]{q[resident_mb]} : ( $_[0]{q[resident_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__resident_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: resident_mb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 100       3  
  2 50       8  
  2         4  
  2         3  
  2         36  
  0         0  
  0         0  
  2         13  
168              
169             # Aliases for for resident_mb
170 2     2 0 9 sub rss_mb { shift->resident_mb( @_ ) }
171              
172             # Accessors for share
173 1     1   3 *_refresh_share = sub { delete $_[0]->{q[share]}; $_[0]; };
  1         3  
174 24 50 0 24   8510 *share = sub { @_ > 1 ? require Carp && Carp::croak("share is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[share]}) ? $_[0]{q[share]} : ( $_[0]{q[share]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__share_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: share should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 100       4  
  2 50       8  
  2         4  
  2         4  
  2         36  
  0         0  
  0         0  
  2         13  
175              
176             # Aliases for for share
177 4     4 0 12 sub share_pages { shift->share( @_ ) }
178              
179             # Accessors for share_bytes
180 1     1   3 *_refresh_share_bytes = sub { delete $_[0]->{q[share_bytes]}; $_[0]; };
  1         2  
181 2 50 0 2   13 *share_bytes = sub { @_ > 1 ? require Carp && Carp::croak("share_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[share_bytes]}) ? $_[0]{q[share_bytes]} : ( $_[0]{q[share_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__share_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: share_bytes should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 50       5  
  2 50       6  
  2         5  
  2         4  
  2         41  
  0         0  
  0         0  
  2         11  
182              
183             # Accessors for share_kb
184 1     1   3 *_refresh_share_kb = sub { delete $_[0]->{q[share_kb]}; $_[0]; };
  1         2  
185 2 50 0 2   12 *share_kb = sub { @_ > 1 ? require Carp && Carp::croak("share_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[share_kb]}) ? $_[0]{q[share_kb]} : ( $_[0]{q[share_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__share_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: share_kb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 50       4  
  2 50       8  
  2         4  
  2         4  
  2         45  
  0         0  
  0         0  
  2         14  
186              
187             # Accessors for share_mb
188 1     1   3 *_refresh_share_mb = sub { delete $_[0]->{q[share_mb]}; $_[0]; };
  1         2  
189 2 50 0 2   13 *share_mb = sub { @_ > 1 ? require Carp && Carp::croak("share_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[share_mb]}) ? $_[0]{q[share_mb]} : ( $_[0]{q[share_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__share_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: share_mb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 50       4  
  2 50       7  
  2         4  
  2         4  
  2         42  
  0         0  
  0         0  
  2         14  
190              
191             # Accessors for size
192 1     1   2 *_refresh_size = sub { delete $_[0]->{q[size]}; $_[0]; };
  1         3  
193 46 50 0 46   1590 *size = sub { @_ > 1 ? require Carp && Carp::croak("size is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[size]}) ? $_[0]{q[size]} : ( $_[0]{q[size]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__size_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: size should be Int]) }; $default_value } ) ) };
  2 50 33     6  
  2 100       3  
  2 50       9  
  2         4  
  2         5  
  2         40  
  0         0  
  0         0  
  2         12  
194              
195             # Aliases for for size
196 4     4 0 13 sub size_pages { shift->size( @_ ) }
197 16     16 1 2264 sub vsz { shift->size( @_ ) }
198 4     4 0 13 sub vsz_pages { shift->size( @_ ) }
199              
200             # Accessors for size_bytes
201 1     1   9 *_refresh_size_bytes = sub { delete $_[0]->{q[size_bytes]}; $_[0]; };
  1         3  
202 4 50 0 4   26 *size_bytes = sub { @_ > 1 ? require Carp && Carp::croak("size_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[size_bytes]}) ? $_[0]{q[size_bytes]} : ( $_[0]{q[size_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__size_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: size_bytes should be Int]) }; $default_value } ) ) };
  2 50 33     3  
  2 100       4  
  2 50       8  
  2         4  
  2         4  
  2         44  
  0         0  
  0         0  
  2         11  
203              
204             # Aliases for for size_bytes
205 2     2 0 10 sub vsz_bytes { shift->size_bytes( @_ ) }
206              
207             # Accessors for size_kb
208 1     1   1 *_refresh_size_kb = sub { delete $_[0]->{q[size_kb]}; $_[0]; };
  1         3  
209 4 50 0 4   25 *size_kb = sub { @_ > 1 ? require Carp && Carp::croak("size_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[size_kb]}) ? $_[0]{q[size_kb]} : ( $_[0]{q[size_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__size_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: size_kb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 100       4  
  2 50       8  
  2         6  
  2         4  
  2         40  
  0         0  
  0         0  
  2         14  
210              
211             # Aliases for for size_kb
212 2     2 0 10 sub vsz_kb { shift->size_kb( @_ ) }
213              
214             # Accessors for size_mb
215 1     1   3 *_refresh_size_mb = sub { delete $_[0]->{q[size_mb]}; $_[0]; };
  1         3  
216 4 50 0 4   25 *size_mb = sub { @_ > 1 ? require Carp && Carp::croak("size_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[size_mb]}) ? $_[0]{q[size_mb]} : ( $_[0]{q[size_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__size_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: size_mb should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 100       4  
  2 50       9  
  2         5  
  2         4  
  2         28  
  0         0  
  0         0  
  2         14  
217              
218             # Aliases for for size_mb
219 2     2 0 9 sub vsz_mb { shift->size_mb( @_ ) }
220              
221             # Accessors for statm
222 26 50 0 26   127 *statm = sub { @_ > 1 ? require Carp && Carp::croak("statm is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[statm]}) ? $_[0]{q[statm]} : ( $_[0]{q[statm]} = do { my $default_value = $_[0]->_build_statm; do { package Linux::Statm::Tiny::Mite; (ref($default_value) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$default_value}) { ($ok = 0, last) unless (do { my $tmp = $i; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) }; $ok } } or do { require Carp; Carp::croak(q[Type check failed in default: statm should be ArrayRef[Int]]) }; $default_value } ) ) };
  1 50 33     5  
  1 50       2  
  1 50       10  
  1 100       3  
  1 50       2  
  1         3  
  7         10  
  7         9  
  7         46  
  1         8  
  0         0  
  0         0  
  1         14  
223             *refresh = sub { do { package Linux::Statm::Tiny::Mite; (ref($_[1]) eq 'ARRAY') and do { my $ok = 1; for my $i (@{$_[1]}) { ($ok = 0, last) unless (do { my $tmp = $i; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) }; $ok } } or require Carp && Carp::croak(q[Type check failed in writer: value should be ArrayRef[Int]]); $_[0]{q[statm]} = $_[1]; $_[0]; };
224              
225             # Accessors for text
226 1     1   2 *_refresh_text = sub { delete $_[0]->{q[text]}; $_[0]; };
  1         2  
227 24 50 0 24   1511 *text = sub { @_ > 1 ? require Carp && Carp::croak("text is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[text]}) ? $_[0]{q[text]} : ( $_[0]{q[text]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__text_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: text should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 100       4  
  2 50       10  
  2         5  
  2         3  
  2         33  
  0         0  
  0         0  
  2         13  
228              
229             # Aliases for for text
230 4     4 0 14 sub text_pages { shift->text( @_ ) }
231              
232             # Accessors for text_bytes
233 1     1   2 *_refresh_text_bytes = sub { delete $_[0]->{q[text_bytes]}; $_[0]; };
  1         3  
234 2 50 0 2   12 *text_bytes = sub { @_ > 1 ? require Carp && Carp::croak("text_bytes is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[text_bytes]}) ? $_[0]{q[text_bytes]} : ( $_[0]{q[text_bytes]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__text_bytes_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: text_bytes should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 50       5  
  2 50       7  
  2         5  
  2         3  
  2         39  
  0         0  
  0         0  
  2         13  
235              
236             # Accessors for text_kb
237 1     1   5 *_refresh_text_kb = sub { delete $_[0]->{q[text_kb]}; $_[0]; };
  1         4  
238 2 50 0 2   12 *text_kb = sub { @_ > 1 ? require Carp && Carp::croak("text_kb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[text_kb]}) ? $_[0]{q[text_kb]} : ( $_[0]{q[text_kb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__text_kb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: text_kb should be Int]) }; $default_value } ) ) };
  2 50 33     4  
  2 50       4  
  2 50       8  
  2         4  
  2         4  
  2         38  
  0         0  
  0         0  
  2         14  
239              
240             # Accessors for text_mb
241 1     1   2 *_refresh_text_mb = sub { delete $_[0]->{q[text_mb]}; $_[0]; };
  1         3  
242 2 50 0 2   13 *text_mb = sub { @_ > 1 ? require Carp && Carp::croak("text_mb is a read-only attribute of @{[ref $_[0]]}") : ( exists($_[0]{q[text_mb]}) ? $_[0]{q[text_mb]} : ( $_[0]{q[text_mb]} = do { my $default_value = do { my $method = $Linux::Statm::Tiny::__text_mb_DEFAULT__; $_[0]->$method }; (do { my $tmp = $default_value; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) or do { require Carp; Carp::croak(q[Type check failed in default: text_mb should be Int]) }; $default_value } ) ) };
  2 50 33     5  
  2 50       4  
  2 50       9  
  2         5  
  2         4  
  2         44  
  0         0  
  0         0  
  2         9  
243              
244              
245             1;
246             }
247              
248             __END__