Branch Coverage

Shared.xs
Criterion Covered Total %
branch 90 166 54.2


line true false branch
33 0 18 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
0 0 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
7 11 const char *p = (SvGETMAGIC(path), SvOK(path)) ? SvPV_nolen(path) : NULL;
35 0 18 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
0 0 mode_t mode = (items > 4 && (SvGETMAGIC(ST(4)), SvOK(ST(4)))) ? (mode_t)SvUV(ST(4)) : 0600;
36 0 18 if (max_strings > SI_MAX_STRINGS) croak("Data::Intern::Shared->new: max_strings exceeds 2^30");
37 0 18 if (arena_bytes > UINT32_MAX) croak("Data::Intern::Shared->new: arena_bytes exceeds 2^32");
39 2 16 if (!h) croak("Data::Intern::Shared->new: %s", errbuf);
53 0 2 const char *nm = (SvGETMAGIC(name), SvOK(name)) ? SvPV_nolen(name) : NULL; /* undef -> default label */
0 0 const char *nm = (SvGETMAGIC(name), SvOK(name)) ? SvPV_nolen(name) : NULL; /* undef -> default label */
1 1 const char *nm = (SvGETMAGIC(name), SvOK(name)) ? SvPV_nolen(name) : NULL; /* undef -> default label */
54 0 2 if (max_strings > SI_MAX_STRINGS) croak("Data::Intern::Shared->new_memfd: max_strings exceeds 2^30");
55 0 2 if (arena_bytes > UINT32_MAX) croak("Data::Intern::Shared->new_memfd: arena_bytes exceeds 2^32");
57 0 2 if (!h) croak("Data::Intern::Shared->new_memfd: %s", errbuf);
70 0 1 if (!h) croak("Data::Intern::Shared->new_from_fd: %s", errbuf);
79 20 0 if (sv_isobject(self) && sv_derived_from(self, "Data::Intern::Shared")) {
20 0 if (sv_isobject(self) && sv_derived_from(self, "Data::Intern::Shared")) {
81 19 1 if (h) { sv_setiv(SvRV(self), 0); si_destroy(h); } /* null first: activates EXTRACT's use-after-destroy croak + makes a double DESTROY a no-op */
88 16 0 EXTRACT(self);
0 16 EXTRACT(self);
1 15 EXTRACT(self);
100 3 0 EXTRACT(self);
0 3 EXTRACT(self);
0 3 EXTRACT(self);
102 0 3 RETVAL = h->hdr->max_strings;
110 3 0 EXTRACT(self);
0 3 EXTRACT(self);
0 3 EXTRACT(self);
112 0 3 RETVAL = h->hdr->arena_bytes;
120 3 0 EXTRACT(self);
0 3 EXTRACT(self);
0 3 EXTRACT(self);
132 2 0 EXTRACT(self);
0 2 EXTRACT(self);
0 2 EXTRACT(self);
143 41539 0 EXTRACT(self);
0 41539 EXTRACT(self);
0 41539 EXTRACT(self);
153 41535 4 RETVAL = (id < 0) ? &PL_sv_undef : newSVuv((UV)id);
162 37013 0 EXTRACT(self);
0 37013 EXTRACT(self);
0 37013 EXTRACT(self);
171 37011 2 RETVAL = found ? newSVuv(id) : &PL_sv_undef;
180 37017 0 EXTRACT(self);
0 37017 EXTRACT(self);
0 37017 EXTRACT(self);
190 37015 2 if (id < h->hdr->count) {
193 37015 0 if (off <= used && used - off >= sizeof(uint32_t)) {
37015 0 if (off <= used && used - off >= sizeof(uint32_t)) {
196 37015 0 if (l <= used - off - (uint32_t)sizeof(uint32_t)) {
202 37013 2 if (l) { tmp = (char *)malloc(l); if (tmp) memcpy(tmp, str, l); }
37013 0 if (l) { tmp = (char *)malloc(l); if (tmp) memcpy(tmp, str, l); }
207 2 37015 if (!found) RETVAL = &PL_sv_undef;
208 2 37013 else if (tl == 0) RETVAL = newSVpvn("", 0);
209 37013 0 else if (tmp) { RETVAL = newSVpvn(tmp, tl); free(tmp); }
220 35611 0 EXTRACT(self);
0 35611 EXTRACT(self);
0 35611 EXTRACT(self);
236 1 0 EXTRACT(self);
0 1 EXTRACT(self);
0 1 EXTRACT(self);
261 4 0 EXTRACT(self);
0 4 EXTRACT(self);
0 4 EXTRACT(self);
263 1 3 RETVAL = h->path ? newSVpv(h->path, 0) : &PL_sv_undef;
271 4 0 EXTRACT(self);
0 4 EXTRACT(self);
0 4 EXTRACT(self);
273 0 4 RETVAL = h->backing_fd;
281 4 0 EXTRACT(self);
0 4 EXTRACT(self);
0 4 EXTRACT(self);
283 0 4 if (si_msync(h) != 0) croak("sync: %s", strerror(errno));
289 1 1 if (sv_isobject(self) && sv_derived_from(self, "Data::Intern::Shared")) {
1 0 if (sv_isobject(self) && sv_derived_from(self, "Data::Intern::Shared")) {
291 1 0 if (h && h->path) unlink(h->path);
1 0 if (h && h->path) unlink(h->path);
292 1 0 } else if (items >= 2 && (SvGETMAGIC(ST(1)), SvOK(ST(1)))) {
0 1 } else if (items >= 2 && (SvGETMAGIC(ST(1)), SvOK(ST(1)))) {
0 0 } else if (items >= 2 && (SvGETMAGIC(ST(1)), SvOK(ST(1)))) {
1 0 } else if (items >= 2 && (SvGETMAGIC(ST(1)), SvOK(ST(1)))) {