xs/abi.xs

filter: Statementstmt 100% 9 / 9 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 94.1% 16 / 17 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/wipe.c ↑ Summary Primitives.xs »
1 UV
2 _abi_ptr(version, size)
3 SV *version
4 SV *size
5 PREINIT:
6 const symprim_abi *table;
7 uint32_t asked, room;
8 CODE:
9 /* What another extension asks for when it loads: the table of
10 * symprim_abi.h, at the version it was written against or any later,
11 * and no shorter than the table it was compiled with. It is never asked
12 * to be equal: the table only grows at its end. The address is unsigned,
13 * since where the loader put this object decides its top bit. */
14 42 asked = number_between(aTHX_ "_abi_ptr", "the version", settled(aTHX_ version), 1, 0xFFFFFFFFUL);
15 33 room = number_between(aTHX_ "_abi_ptr", "the size", settled(aTHX_ size), 8, 0xFFFFFFFFUL);
16 23 table = symprim_abi_table();
17 23 ▶ if (asked > table->abi_version)
Branch: 1 branch
BranchTrueFalseTotal
if (asked > table->abi_version) 3 20 23
18 3 croak("Crypt::Symmetric::Primitives: version %lu of the C interface was asked for and this is version %lu",
19 (unsigned long)asked, (unsigned long)table->abi_version);
20 20 ▶ if (room > table->size)
Branch: 1 branch
BranchTrueFalseTotal
if (room > table->size) 3 17 20
21 3 croak("Crypt::Symmetric::Primitives: a C interface table of %lu bytes was asked for and this one is %lu",
22 (unsigned long)room, (unsigned long)table->size);
23 17 ▶ RETVAL = PTR2UV(table);
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = PTR2UV(table); 8 9 17
24 OUTPUT:
25 RETVAL
26  
27 UV
28 _abi_version()
29 CODE:
30 1 ▶ RETVAL = symprim_abi_table()->abi_version;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = symprim_abi_table()->abi_version; 0 1 1
31 OUTPUT:
32 RETVAL
« src/wipe.c ↑ Summary Primitives.xs »