blib/lib/Wasm/Wasmtime/Store.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 92.5% 37 / 40 CC 2 SCAR 2.2
CC
2
Cov
97%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Wasm/Wasmtime/Table.pm ↑ Summary blib/lib/Wasm/Wasmtime/WasiConfig.pm »
1 package Wasm::Wasmtime::Store;
2  
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 25 ▶use 5.008004;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 25 ▶use Wasm::Wasmtime::FFI;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 25 ▶use Wasm::Wasmtime::Engine;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # TODO: wasmtime_store_add_fuel
10 # TODO: wasmtime_store_fuel_consumed
11  
12 # ABSTRACT: Wasmtime store class
13 25 our $VERSION = '0.23'; # VERSION
14  
15  
16 25 $ffi_prefix = 'wasm_store_';
17 25 $ffi->load_custom_type('::PtrObject' => 'wasm_store_t' => __PACKAGE__);
18  
19  
20 $ffi->attach( new => ['wasm_engine_t'] => 'wasm_store_t' => sub {
21 44 ▶ my($xsub, $class, $engine) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.0
22 44 ▶ $engine ||= Wasm::Wasmtime::Engine->new;
Condition66%2/3
$engine ||= "Wasm::Wasmtime::Engine"->new
l!l&&r!l&&!r
17270
MC/DC0%0/2
$engine ||= "Wasm::Wasmtime::Engine"->new
$engine "Wasm::Wasmtime::Engine"->new
Truth table66%2/3
A ||= B
A= $engineB= "Wasm::Wasmtime::Engine"->new
ABresult
1X1
011
000
23 44 my $self = $xsub->($engine);
24 44 $self->{engine} = $engine;
25 44 $self;
26 25 });
27  
28  
29 25 $ffi->attach( [ wasmtime_store_gc => 'gc' ] => ['wasm_store_t'] => 'void' );
30  
31  
32 47 ▶sub engine { shift->{engine} }
Subroutine engine: called CC=1 SCAR=0.0
Pod documented
33  
34 25 _generate_destroy();
35  
36 25 1;
37  
38 __END__
« blib/lib/Wasm/Wasmtime/Table.pm ↑ Summary blib/lib/Wasm/Wasmtime/WasiConfig.pm »