xs/abi.xs

filter: Statementstmt 100% 9 / 9 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 73.6% 14 / 19 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/vars.xs ↑ Summary xs/test.xs »
1 # The C ABI's Perl-visible ends: the table's address, its version, the
2 # selftest that walks it, and the version of the HAMT table this module
3 # resolved when it loaded.
4  
5 MODULE = Context::Vars PACKAGE = Context::Vars
6  
7 # Unsigned, not IV: where the loader maps this object decides the sign bit, and
8 # a 32-bit perl above 0x7fffffff would hand back a negative from PTR2IV.
9 UV
10 _abi_ptr()
11 CODE:
12 4 ▶ RETVAL = PTR2UV(&CONTEXT_VARS_ABI);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = PTR2UV(&CONTEXT_VARS_ABI); 0 4 4
13 OUTPUT:
14 RETVAL
15  
16 IV
17 _abi_version()
18 CODE:
19 2 ▶ RETVAL = CONTEXT_VARS_ABI.abi_version;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = CONTEXT_VARS_ABI.abi_version; 0 2 2
20 OUTPUT:
21 RETVAL
22  
23 # The number of the first check that did not hold, or 0; and an object for a
24 # context the checks built through the table, for the Perl side to read.
25 void
26 _abi_selftest()
27 PPCODE:
28 {
29 3 int step = 0;
30 3 SV *obj = context_vars_abi_selftest(aTHX_ &step);
31 3 ▶ EXTEND(SP, 2);
Branch: 1 branch
BranchTrueFalseTotal
EXTEND(SP, 2); 0 3 3
32 3 PUSHs(sv_2mortal(newSViv(step)));
33 3 PUSHs(obj);
34 }
35  
36 # What HAMT's table said its version was when this module loaded. The module
37 # does not load without one, so this is never zero.
38 IV
39 _hamt_abi_version()
40 CODE:
41 3 ▶ RETVAL = CONTEXT_VARS_HAMT->abi_version;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = CONTEXT_VARS_HAMT->abi_version; 0 3 3
42 OUTPUT:
43 RETVAL
44  
45 # The version of HAMT's table this module was COMPILED against, which is the
46 # least it accepts.
47 IV
48 _hamt_abi_needed()
49 CODE:
50 1 ▶ RETVAL = HAMT_ABI_VERSION;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = HAMT_ABI_VERSION; 0 1 1
51 OUTPUT:
52 RETVAL
« xs/vars.xs ↑ Summary xs/test.xs »