line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Readonly::XS - Companion module for Readonly.pm, to speed up read-only |
4
|
|
|
|
|
|
|
scalar variables. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 VERSION |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
This document describes version 1.05 of Readonly::XS, February 24, 2009. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=cut |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Readonly::XS; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
54750
|
use strict; |
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
4711
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
15
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
16
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION $MAGIC_COOKIE); |
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
544
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
120
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$VERSION = '1.05'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
require XSLoader; |
21
|
|
|
|
|
|
|
XSLoader::load('Readonly::XS', $VERSION); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# It is an error to use this from any module but Readonly. |
25
|
|
|
|
|
|
|
# But sooner or later, someone will. |
26
|
|
|
|
|
|
|
BEGIN |
27
|
|
|
|
|
|
|
{ |
28
|
1
|
|
|
1
|
|
9
|
no warnings 'uninitialized'; |
|
1
|
|
|
1
|
|
1
|
|
|
1
|
|
|
|
|
60
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
29
|
1
|
50
|
|
1
|
|
89
|
if ($MAGIC_COOKIE ne "Do NOT use or require Readonly::XS unless you're me.") |
|
1
|
50
|
|
1
|
|
55
|
|
30
|
|
|
|
|
|
|
{ |
31
|
1
|
|
|
|
|
7
|
require Carp; |
|
0
|
|
|
|
|
0
|
|
32
|
1
|
|
|
|
|
294
|
Carp::croak("Readonly::XS is not a standalone module. You should not use it directly."); |
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub import |
37
|
|
|
|
|
|
|
{ |
38
|
1
|
|
|
1
|
|
6
|
my $func; |
39
|
1
|
|
|
|
|
14
|
for $func (qw/is_sv_readonly make_sv_readonly/) |
40
|
|
|
|
|
|
|
{ |
41
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
42
|
1
|
|
|
1
|
|
6
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
102
|
|
43
|
2
|
|
|
|
|
4
|
*{"Readonly::$func"} = \&$func; |
|
2
|
|
|
|
|
15
|
|
44
|
|
|
|
|
|
|
} |
45
|
1
|
|
|
|
|
13
|
$Readonly::XSokay = 1; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |