GraphArenas.xs

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 31 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Internals/GraphArenas.pm ↑ Summary
1 #include "string.h"
2 #include "EXTERN.h"
3 #include "perl.h"
4 #include "XSUB.h"
5 #include "ppport.h"
6  
7 typedef void (*SVFUNC2_t) (pTHX_ SV*, SV*);
8  
9 static void
10 0 safe_write( const void *buf, size_t numbytes )
11 {
12 0 ▶ if ( ! PerlIO_write( PerlIO_stdout(), buf, numbytes ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ( ! PerlIO_write( PerlIO_stdout(), buf, numbytes ) ) { 0 0 0
13 0 croak( "Can't write to stdout: %s", strerror( errno ) );
14 }
15 0 }
16  
17 static void
18 0 do_graph_arenas(SV *sva, SV *sv)
19 {
20 0 safe_write( &sva, sizeof(SV*) );
21 0 safe_write( &sv, sizeof(SV*) );
22 0 safe_write( &(SvANY(sv)), sizeof(SV*) );
23 0 }
24  
25 static void
26 0 my_visit( SVFUNC2_t f, U32 flags, U32 mask)
27 {
28 SV* sva;
29 SV* sv;
30 register SV* svend;
31  
32 0 ▶ for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) {
Branch: 1 branch
BranchTrueFalseTotal
for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) { 0 0 0
33 0 svend = &sva[SvREFCNT(sva)];
34 0 ▶ for (sv = sva + 1; sv < svend; ++sv) {
Branch: 1 branch
BranchTrueFalseTotal
for (sv = sva + 1; sv < svend; ++sv) { 0 0 0
35 0 ▶ if (SvTYPE(sv) != SVTYPEMASK
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(sv) != SVTYPEMASK 0 0 0
36 0 ▶ && (sv->sv_flags & mask) == flags
Branch: 1 branch
BranchTrueFalseTotal
&& (sv->sv_flags & mask) == flags 0 0 0
37 0 ▶ && SvREFCNT(sv))
Branch: 1 branch
BranchTrueFalseTotal
&& SvREFCNT(sv)) 0 0 0
38 {
39 0 (*f)( sva, sv );
40 }
41 }
42 }
43 0 }
44  
45 MODULE = Internals::GraphArenas PACKAGE = Internals
46  
47 PROTOTYPES: DISABLE
48  
49 void
50 graph_arenas()
51 CODE:
52 0 my_visit(do_graph_arenas, 0, 0);
« blib/lib/Internals/GraphArenas.pm ↑ Summary