mg->mg_private = 0;
+ if (vtbl->svt_copy)
+ mg->mg_flags |= MGf_COPY;
+#if MGf_DUP
+ if (vtbl->svt_dup)
+ mg->mg_flags |= MGf_DUP;
+#endif /* MGf_DUP */
+#if MGf_LOCAL
+ if (vtbl->svt_local)
+ mg->mg_flags |= MGf_LOCAL;
+#endif /* MGf_LOCAL */
+
if (mg->mg_flags & MGf_REFCOUNTED)
SvREFCNT_dec(obj);
wiz = newSViv(PTR2IV(w));
#endif
- if (w) {
- MAGIC *mg;
- mg = vmg_sv_magicext(wiz, NULL, &vmg_wizard_sv_vtbl, w, 0);
-#if VMG_THREADSAFE
- mg->mg_flags |= MGf_DUP;
-#endif
- }
+ vmg_sv_magicext(wiz, NULL, &vmg_wizard_sv_vtbl, w, 0);
+
SvREADONLY_on(wiz);
return wiz;
t = vmg_vtable_vtbl(w->vtable);
mg = vmg_sv_magicext(sv, data, t, wiz, HEf_SVKEY);
- if (t->svt_copy)
- mg->mg_flags |= MGf_COPY;
-#if 0
- if (t->svt_dup)
- mg->mg_flags |= MGf_DUP;
-#endif
-#if MGf_LOCAL
- if (t->svt_local)
- mg->mg_flags |= MGf_LOCAL;
-#endif /* MGf_LOCAL */
-
if (SvTYPE(sv) < SVt_PVHV)
goto done;