File Coverage

hax/newSV_with_free.c.inc
Criterion Covered Total %
statement 0 8 0.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 0 8 0.0


line stmt bran cond sub pod time code
1             /* vi: set ft=c : */
2              
3 0           static int magic_free(pTHX_ SV *sv, MAGIC *mg)
4             {
5 0           void (*freefunc)(pTHX_ SV *sv) = (void *)mg->mg_ptr;
6 0           (*freefunc)(aTHX_ sv);
7 0           }
8              
9             static const MGVTBL vtbl_sv_with_free = {
10             .svt_free = magic_free,
11             };
12              
13             #define newSV_with_free(size, freefunc) S_newSV_with_free(aTHX_ size, freefunc)
14 0           static SV *S_newSV_with_free(pTHX_ STRLEN size, void (*freefunc)(pTHX_ SV *sv))
15             {
16 0           SV *sv = newSV(size);
17 0           sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_sv_with_free, (void *)freefunc, 0);
18 0           return sv;
19             }