hax/newSV_with_free.c.inc

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 8 / 8 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« hax/make_argcheck_aux.c.inc ↑ Summary t/actions.xs »
1 /* vi: set ft=c : */
2  
3 8 static int magic_free(pTHX_ SV *sv, MAGIC *mg)
4 {
5 8 void (*freefunc)(pTHX_ SV *sv) = (void *)mg->mg_ptr;
6 8 (*freefunc)(aTHX_ sv);
7 8 return 0;
8 }
9  
10 static const MGVTBL vtbl_sv_with_free = {
11 .svt_free = magic_free,
12 };
13  
14 #define newSV_with_free(size, freefunc) S_newSV_with_free(aTHX_ size, freefunc)
15 8 static SV *S_newSV_with_free(pTHX_ STRLEN size, void (*freefunc)(pTHX_ SV *sv))
16 {
17 8 SV *sv = newSV(size);
18 8 sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_sv_with_free, (void *)freefunc, 0);
19 8 return sv;
20 }
« hax/make_argcheck_aux.c.inc ↑ Summary t/actions.xs »