From: Vincent Pit Date: Wed, 6 Jan 2010 22:54:49 +0000 (+0100) Subject: Use SvREFCNT_inc_simple_void() whenever possible X-Git-Tag: v0.40~3 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4ff0f6dd08624463de49131d8a1375e857077b4b;p=perl%2Fmodules%2FVariable-Magic.git Use SvREFCNT_inc_simple_void() whenever possible --- diff --git a/Magic.xs b/Magic.xs index 3ec0b6f..cc40364 100644 --- a/Magic.xs +++ b/Magic.xs @@ -104,6 +104,10 @@ STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) { # define SvRV_const(sv) SvRV((SV *) sv) #endif +#ifndef SvREFCNT_inc_simple_void +# define SvREFCNT_inc_simple_void(sv) SvREFCNT_inc(sv) +#endif + #ifndef mPUSHu # define mPUSHu(U) PUSHs(sv_2mortal(newSVuv(U))) #endif @@ -633,9 +637,9 @@ STATIC SV *vmg_data_new(pTHX_ SV *ctor, SV *sv, SV **args, I32 items) { SPAGAIN; nsv = POPs; #if VMG_HAS_PERL(5, 8, 3) - SvREFCNT_inc(nsv); /* Or it will be destroyed in FREETMPS */ + SvREFCNT_inc_simple_void(nsv); /* Or it will be destroyed in FREETMPS */ #else - nsv = sv_newref(nsv); /* Workaround some bug in SvREFCNT_inc() */ + nsv = sv_newref(nsv); /* Workaround some bug in SvREFCNT_inc() */ #endif PUTBACK; @@ -1052,7 +1056,7 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) { w = vmg_wizard_mgwiz(mg->mg_ptr); /* So that it survives the temp cleanup below */ - SvREFCNT_inc(sv); + SvREFCNT_inc_simple_void(sv); #if !VMG_HAS_PERL_MAINT(5, 11, 0, 32686) /* The previous magic tokens were freed but the magic chain wasn't updated, so