| 1 |
|
| # The C ABI's Perl-visible ends: the table's address, its version, and the |
| 2 |
|
| # selftest that walks it. |
| 3 |
|
| |
| 4 |
|
| MODULE = HAMT PACKAGE = HAMT |
| 5 |
|
| |
| 6 |
|
| # Unsigned, not IV: where the loader maps this object decides the sign bit, and |
| 7 |
|
| # a 32-bit perl above 0x7fffffff would hand back a negative from PTR2IV. |
| 8 |
|
| UV |
| 9 |
|
| _abi_ptr() |
| 10 |
|
| CODE: |
| 11 |
4 |
▶ | RETVAL = PTR2UV(&HAMT_ABI); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = PTR2UV(&HAMT_ABI); |
0 |
4 |
4 |
|
| 12 |
|
| OUTPUT: |
| 13 |
|
| RETVAL |
| 14 |
|
| |
| 15 |
|
| IV |
| 16 |
|
| _abi_version() |
| 17 |
|
| CODE: |
| 18 |
2 |
▶ | RETVAL = HAMT_ABI.abi_version; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = HAMT_ABI.abi_version; |
0 |
2 |
2 |
|
| 19 |
|
| OUTPUT: |
| 20 |
|
| RETVAL |
| 21 |
|
| |
| 22 |
|
| # The number of the check that failed, or 0, and then a map, a set and a |
| 23 |
|
| # vector that were built in C through the table, for the Perl surface to |
| 24 |
|
| # read back. A negative number is a check that failed AND left something |
| 25 |
|
| # allocated behind it. |
| 26 |
|
| void |
| 27 |
|
| _abi_selftest() |
| 28 |
|
| PREINIT: |
| 29 |
7 |
| SV *map = NULL, *set = NULL, *vec = NULL; |
| 30 |
|
| int step; |
| 31 |
|
| PPCODE: |
| 32 |
7 |
| step = hamt_abi_selftest(aTHX_ &map, &set, &vec); |
| 33 |
7 |
▶ | EXTEND(SP, 4); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(SP, 4); |
0 |
7 |
7 |
|
| 34 |
7 |
| PUSHs(sv_2mortal(newSViv(step))); |
| 35 |
7 |
▶ | PUSHs(map ? sv_2mortal(map) : &PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| PUSHs(map ? sv_2mortal(map) : &PL_sv_undef); |
7 |
0 |
7 |
|
| 36 |
7 |
▶ | PUSHs(set ? sv_2mortal(set) : &PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| PUSHs(set ? sv_2mortal(set) : &PL_sv_undef); |
7 |
0 |
7 |
|
| 37 |
7 |
▶ | PUSHs(vec ? sv_2mortal(vec) : &PL_sv_undef); |
Branch: 1 branch
| Branch | True | False | Total |
| PUSHs(vec ? sv_2mortal(vec) : &PL_sv_undef); |
7 |
0 |
7 |
|