| Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/IO/Uncompress/Adapter/Inflate.pm |
| Statements | Executed 14 statements in 485µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 25µs | 29µs | IO::Uncompress::Adapter::Inflate::BEGIN@3 |
| 1 | 1 | 1 | 11µs | 106µs | IO::Uncompress::Adapter::Inflate::BEGIN@7 |
| 1 | 1 | 1 | 8µs | 37µs | IO::Uncompress::Adapter::Inflate::BEGIN@8 |
| 1 | 1 | 1 | 6µs | 37µs | IO::Uncompress::Adapter::Inflate::BEGIN@4 |
| 1 | 1 | 1 | 6µs | 8µs | IO::Uncompress::Adapter::Inflate::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::adler32 |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::compressedBytes |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::crc32 |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::createDeflateStream |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::getEndOffset |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::getLastBlockOffset |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::mkUncompObject |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::reset |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::resetLastBlockByte |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::sync |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::uncompr |
| 0 | 0 | 0 | 0s | 0s | IO::Uncompress::Adapter::Inflate::uncompressedBytes |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package IO::Uncompress::Adapter::Inflate; | ||||
| 2 | |||||
| 3 | 2 | 27µs | 2 | 33µs | # spent 29µs (25+4) within IO::Uncompress::Adapter::Inflate::BEGIN@3 which was called:
# once (25µs+4µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 3 # spent 29µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@3
# spent 4µs making 1 call to strict::import |
| 4 | 2 | 15µs | 2 | 68µs | # spent 37µs (6+31) within IO::Uncompress::Adapter::Inflate::BEGIN@4 which was called:
# once (6µs+31µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 4 # spent 37µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@4
# spent 31µs making 1 call to warnings::import |
| 5 | 2 | 22µs | 2 | 10µs | # spent 8µs (6+2) within IO::Uncompress::Adapter::Inflate::BEGIN@5 which was called:
# once (6µs+2µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 5 # spent 8µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@5
# spent 2µs making 1 call to bytes::import |
| 6 | |||||
| 7 | 3 | 37µs | 3 | 201µs | # spent 106µs (11+95) within IO::Uncompress::Adapter::Inflate::BEGIN@7 which was called:
# once (11µs+95µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 7 # spent 106µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@7
# spent 88µs making 1 call to Exporter::import
# spent 7µs making 1 call to UNIVERSAL::VERSION |
| 8 | 3 | 381µs | 3 | 66µs | # spent 37µs (8+29) within IO::Uncompress::Adapter::Inflate::BEGIN@8 which was called:
# once (8µs+29µs) by IO::Uncompress::RawInflate::BEGIN@12 at line 8 # spent 37µs making 1 call to IO::Uncompress::Adapter::Inflate::BEGIN@8
# spent 25µs making 1 call to Exporter::import
# spent 4µs making 1 call to UNIVERSAL::VERSION |
| 9 | |||||
| 10 | our ($VERSION); | ||||
| 11 | 1 | 0s | $VERSION = '2.106'; | ||
| 12 | |||||
| - - | |||||
| 15 | sub mkUncompObject | ||||
| 16 | { | ||||
| 17 | my $crc32 = shift || 1; | ||||
| 18 | my $adler32 = shift || 1; | ||||
| 19 | my $scan = shift || 0; | ||||
| 20 | |||||
| 21 | my $inflate ; | ||||
| 22 | my $status ; | ||||
| 23 | |||||
| 24 | if ($scan) | ||||
| 25 | { | ||||
| 26 | ($inflate, $status) = Compress::Raw::Zlib::InflateScan->new( | ||||
| 27 | #LimitOutput => 1, | ||||
| 28 | CRC32 => $crc32, | ||||
| 29 | ADLER32 => $adler32, | ||||
| 30 | WindowBits => - MAX_WBITS ); | ||||
| 31 | } | ||||
| 32 | else | ||||
| 33 | { | ||||
| 34 | ($inflate, $status) = Compress::Raw::Zlib::Inflate->new( | ||||
| 35 | AppendOutput => 1, | ||||
| 36 | LimitOutput => 1, | ||||
| 37 | CRC32 => $crc32, | ||||
| 38 | ADLER32 => $adler32, | ||||
| 39 | WindowBits => - MAX_WBITS ); | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | return (undef, "Could not create Inflation object: $status", $status) | ||||
| 43 | if $status != Z_OK ; | ||||
| 44 | |||||
| 45 | return bless {'Inf' => $inflate, | ||||
| 46 | 'CompSize' => 0, | ||||
| 47 | 'UnCompSize' => 0, | ||||
| 48 | 'Error' => '', | ||||
| 49 | 'ConsumesInput' => 1, | ||||
| 50 | } ; | ||||
| 51 | |||||
| 52 | } | ||||
| 53 | |||||
| 54 | sub uncompr | ||||
| 55 | { | ||||
| 56 | my $self = shift ; | ||||
| 57 | my $from = shift ; | ||||
| 58 | my $to = shift ; | ||||
| 59 | my $eof = shift ; | ||||
| 60 | |||||
| 61 | my $inf = $self->{Inf}; | ||||
| 62 | |||||
| 63 | my $status = $inf->inflate($from, $to, $eof); | ||||
| 64 | $self->{ErrorNo} = $status; | ||||
| 65 | if ($status != Z_OK && $status != Z_STREAM_END && $status != Z_BUF_ERROR) | ||||
| 66 | { | ||||
| 67 | $self->{Error} = "Inflation Error: $status"; | ||||
| 68 | return STATUS_ERROR; | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | return STATUS_OK if $status == Z_BUF_ERROR ; # ??? | ||||
| 72 | return STATUS_OK if $status == Z_OK ; | ||||
| 73 | return STATUS_ENDSTREAM if $status == Z_STREAM_END ; | ||||
| 74 | return STATUS_ERROR ; | ||||
| 75 | } | ||||
| 76 | |||||
| 77 | sub reset | ||||
| 78 | { | ||||
| 79 | my $self = shift ; | ||||
| 80 | $self->{Inf}->inflateReset(); | ||||
| 81 | |||||
| 82 | return STATUS_OK ; | ||||
| 83 | } | ||||
| 84 | |||||
| 85 | #sub count | ||||
| 86 | #{ | ||||
| 87 | # my $self = shift ; | ||||
| 88 | # $self->{Inf}->inflateCount(); | ||||
| 89 | #} | ||||
| 90 | |||||
| 91 | sub crc32 | ||||
| 92 | { | ||||
| 93 | my $self = shift ; | ||||
| 94 | $self->{Inf}->crc32(); | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | sub compressedBytes | ||||
| 98 | { | ||||
| 99 | my $self = shift ; | ||||
| 100 | $self->{Inf}->compressedBytes(); | ||||
| 101 | } | ||||
| 102 | |||||
| 103 | sub uncompressedBytes | ||||
| 104 | { | ||||
| 105 | my $self = shift ; | ||||
| 106 | $self->{Inf}->uncompressedBytes(); | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | sub adler32 | ||||
| 110 | { | ||||
| 111 | my $self = shift ; | ||||
| 112 | $self->{Inf}->adler32(); | ||||
| 113 | } | ||||
| 114 | |||||
| 115 | sub sync | ||||
| 116 | { | ||||
| 117 | my $self = shift ; | ||||
| 118 | ( $self->{Inf}->inflateSync(@_) == Z_OK) | ||||
| 119 | ? STATUS_OK | ||||
| 120 | : STATUS_ERROR ; | ||||
| 121 | } | ||||
| 122 | |||||
| 123 | |||||
| 124 | sub getLastBlockOffset | ||||
| 125 | { | ||||
| 126 | my $self = shift ; | ||||
| 127 | $self->{Inf}->getLastBlockOffset(); | ||||
| 128 | } | ||||
| 129 | |||||
| 130 | sub getEndOffset | ||||
| 131 | { | ||||
| 132 | my $self = shift ; | ||||
| 133 | $self->{Inf}->getEndOffset(); | ||||
| 134 | } | ||||
| 135 | |||||
| 136 | sub resetLastBlockByte | ||||
| 137 | { | ||||
| 138 | my $self = shift ; | ||||
| 139 | $self->{Inf}->resetLastBlockByte(@_); | ||||
| 140 | } | ||||
| 141 | |||||
| 142 | sub createDeflateStream | ||||
| 143 | { | ||||
| 144 | my $self = shift ; | ||||
| 145 | my $deflate = $self->{Inf}->createDeflateStream(@_); | ||||
| 146 | return bless {'Def' => $deflate, | ||||
| 147 | 'CompSize' => 0, | ||||
| 148 | 'UnCompSize' => 0, | ||||
| 149 | 'Error' => '', | ||||
| 150 | }, 'IO::Compress::Adapter::Deflate'; | ||||
| 151 | } | ||||
| 152 | |||||
| 153 | 1 | 3µs | 1; | ||
| 154 | |||||
| 155 | |||||
| 156 | __END__ |