From: Vincent Pit Date: Mon, 30 Nov 2009 00:16:18 +0000 (+0100) Subject: Directly store the CVs into the MGWIZ structure X-Git-Tag: v0.39~9 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=505df7ba40320da17bdda154554d76e372cfc56f;p=perl%2Fmodules%2FVariable-Magic.git Directly store the CVs into the MGWIZ structure Instead of references to CVs. --- diff --git a/Magic.xs b/Magic.xs index a3f40c8..35bc61c 100644 --- a/Magic.xs +++ b/Magic.xs @@ -394,8 +394,7 @@ STATIC void vmg_mgwiz_free(pTHX_ MGWIZ *w) { #if VMG_THREADSAFE #define VMG_CLONE_CB(N) \ - z->cb_ ## N = (w->cb_ ## N) ? newRV_noinc(vmg_clone(SvRV(w->cb_ ## N), \ - w->owner)) \ + z->cb_ ## N = (w->cb_ ## N) ? vmg_clone(w->cb_ ## N, w->owner) \ : NULL; STATIC MGWIZ *vmg_mgwiz_clone(pTHX_ const MGWIZ *w) { @@ -1232,13 +1231,13 @@ STATIC I32 vmg_svt_val(pTHX_ IV action, SV *sv) { #define VMG_SET_CB(S, N) \ cb = (S); \ - w->cb_ ## N = (SvOK(cb) && SvROK(cb)) ? newRV_inc(SvRV(cb)) : NULL; + w->cb_ ## N = (SvOK(cb) && SvROK(cb)) ? SvREFCNT_inc(SvRV(cb)) : NULL; #define VMG_SET_SVT_CB(S, N) \ cb = (S); \ if (SvOK(cb) && SvROK(cb)) { \ t->svt_ ## N = vmg_svt_ ## N; \ - w->cb_ ## N = newRV_inc(SvRV(cb)); \ + w->cb_ ## N = SvREFCNT_inc(SvRV(cb)); \ } else { \ t->svt_ ## N = NULL; \ w->cb_ ## N = NULL; \