| 1 | package Devel::Pointer::PP; | ||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.8.1; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 5 | 2 | ▶ | use B; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Exporter; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 7 | 2 | ▶ | use vars qw(@ISA @SVCLASSNAMES @EXPORT %EXPORT_TAGS $VERSION); | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||
| 9 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 10 | 2 | $VERSION = 1.01; | |||||||||||||||||||||||||
| 11 | 2 | @ISA = 'Exporter'; | |||||||||||||||||||||||||
| 12 | 2 | @EXPORT = qw(address_of | |||||||||||||||||||||||||
| 13 | deref | ||||||||||||||||||||||||||
| 14 | unsmash_sv | ||||||||||||||||||||||||||
| 15 | unsmash_av | ||||||||||||||||||||||||||
| 16 | unsmash_hv | ||||||||||||||||||||||||||
| 17 | unsmash_cv); | ||||||||||||||||||||||||||
| 18 | 2 | %EXPORT_TAGS = ( ':all', \ @EXPORT ); | |||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||
| 20 | 2 | @SVCLASSNAMES = | |||||||||||||||||||||||||
| 21 | map "B::$_", | ||||||||||||||||||||||||||
| 22 | qw( NULL | ||||||||||||||||||||||||||
| 23 | IV | ||||||||||||||||||||||||||
| 24 | NV | ||||||||||||||||||||||||||
| 25 | RV | ||||||||||||||||||||||||||
| 26 | PV | ||||||||||||||||||||||||||
| 27 | PVIV | ||||||||||||||||||||||||||
| 28 | PVNV | ||||||||||||||||||||||||||
| 29 | PVMG | ||||||||||||||||||||||||||
| 30 | BM | ||||||||||||||||||||||||||
| 31 | PVLV | ||||||||||||||||||||||||||
| 32 | AV | ||||||||||||||||||||||||||
| 33 | HV | ||||||||||||||||||||||||||
| 34 | CV | ||||||||||||||||||||||||||
| 35 | GV | ||||||||||||||||||||||||||
| 36 | FM | ||||||||||||||||||||||||||
| 37 | IO ); | ||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||
| 40 | 3 | ▶ | sub address_of { 0 + \ $_[0] } | ||||||||||||||||||||||||
|
Subroutine
address_of: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||
| 42 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=13.4
| |||||||||||||||||||||||||||
| 43 | 2 | for my $name ('unsmash_sv', | |||||||||||||||||||||||||
| 44 | 'unsmash_av', | ||||||||||||||||||||||||||
| 45 | 'unsmash_hv', | ||||||||||||||||||||||||||
| 46 | 'unsmash_cv', | ||||||||||||||||||||||||||
| 47 | 'deref') { | ||||||||||||||||||||||||||
| 48 | 0 | ▶ | eval " | ||||||||||||||||||||||||
|
Subroutine
deref: called CC=2 SCAR=13.7
Subroutine
unsmash_av: not called CC=2 SCAR=13.7
Subroutine
unsmash_cv: not called CC=2 SCAR=13.7
Subroutine
unsmash_hv: not called CC=2 SCAR=13.7
Subroutine
unsmash_sv: not called CC=2 SCAR=13.7
Pod
undocumented
Pod
undocumented
Pod
undocumented
Pod
undocumented
Pod
undocumented
Branch: 5 branches
| |||||||||||||||||||||||||||
| 49 | sub $name { | ||||||||||||||||||||||||||
| 50 | my \$address; | ||||||||||||||||||||||||||
| 51 | if ( \$_[0] =~ /0x([a-f\\d]+)/ ) { | ||||||||||||||||||||||||||
| 52 | \$address = hex \$1; | ||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||
| 54 | else { | ||||||||||||||||||||||||||
| 55 | \$address = 0 + \$_[0]; | ||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||
| 58 | # Temporarilly bless the object as a generic SV so I can query for | ||||||||||||||||||||||||||
| 59 | # the type of the object. | ||||||||||||||||||||||||||
| 60 | my \$obj = bless \\\$address, 'B::SV'; | ||||||||||||||||||||||||||
| 61 | my \$type = \$obj->SvTYPE; | ||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||
| 63 | bless \$obj, \$SVCLASSNAMES[ \$type ]; | ||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||
| 65 | return \$obj->object_2svref; | ||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||
| 67 | "; | ||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||
| 71 | 2 | 1; | |||||||||||||||||||||||||
| 72 | __END__ | ||||||||||||||||||||||||||