blib/lib/Wasm/Wasmtime/Caller.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 9 / 9 Podpod 50.0% 1 / 2 totaltotal 93.7% 45 / 48 CC 3 SCAR 3.3
CC
3
Cov
97%
wasmtime_caller
2.1
__ANON__
2.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Wasm/Wasmtime/Memory.pm ↑ Summary blib/lib/Wasm/Wasmtime/ExternType.pm »
1 package Wasm::Wasmtime::Caller;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 10 ▶use 5.008004;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use Wasm::Wasmtime::FFI;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 10 ▶use Wasm::Wasmtime::Extern;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 10 our @EXPORT = qw( wasmtime_caller );
11  
12 10 $ffi_prefix = 'wasmtime_caller_';
13 10 $ffi->load_custom_type('::PtrObject' => 'wasmtime_caller_t' => __PACKAGE__);
14  
15 # ABSTRACT: Wasmtime caller interface
16 10 our $VERSION = '0.23'; # VERSION
17  
18  
19 10 our @callers;
20  
21 sub wasmtime_caller (;$)
22 {
23 4 ▶ $callers[$_[0]||0]
Subroutine wasmtime_caller: called CC=2 SCAR=7.6
Pod documented
Condition50%1/2
$_[0] || 0
l!l
04
MC/DC0%0/1
$_[0] || 0
$_[0]
Truth table50%1/2
A
A= $_[0]
Aresult
11
00
24 }
25  
26  
27 sub new
28 {
29 11 ▶ my($class, $ptr) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
30 11 bless {
31 ptr => $ptr,
32 }, $class;
33 }
34  
35 $ffi->attach( export_get => ['wasmtime_caller_t','wasm_byte_vec_t*'] => 'wasm_extern_t' => sub {
36 3 ▶ my $xsub = shift;
Subroutine __ANON__: called CC=2 SCAR=6.9
37 3 my $self = shift;
38 3 ▶ return undef unless $self->{ptr};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ptr"} 1 2 3
39 2 my $name = Wasm::Wasmtime::ByteVec->new($_[0]);
40 2 $xsub->($self, $name);
41 10 });
42  
43 10 1;
44  
45 __END__
« blib/lib/Wasm/Wasmtime/Memory.pm ↑ Summary blib/lib/Wasm/Wasmtime/ExternType.pm »