sv_copypv(thread->init_function, init_function);
} else {
thread->init_function =
- SvREFCNT_inc(sv_dup(init_function, &clone_param));
+ sv_dup_inc(init_function, &clone_param);
}
thread->params = params = newAV();
|SSize_t items|NN CLONE_PARAMS *const param
#endif
ApR |SV* |sv_dup |NULLOK const SV *const sstr|NN CLONE_PARAMS *const param
+ApR |SV* |sv_dup_inc |NULLOK const SV *const sstr \
+ |NN CLONE_PARAMS *const param
Ap |void |rvpv_dup |NN SV *const dstr|NN const SV *const sstr|NN CLONE_PARAMS *const param
Ap |yy_parser*|parser_dup |NULLOK const yy_parser *const proto|NN CLONE_PARAMS *const param
#endif
#endif
#endif
#define sv_dup Perl_sv_dup
+#define sv_dup_inc Perl_sv_dup_inc
#define rvpv_dup Perl_rvpv_dup
#define parser_dup Perl_parser_dup
#endif
#endif
#endif
#define sv_dup(a,b) Perl_sv_dup(aTHX_ a,b)
+#define sv_dup_inc(a,b) Perl_sv_dup_inc(aTHX_ a,b)
#define rvpv_dup(a,b,c) Perl_rvpv_dup(aTHX_ a,b,c)
#define parser_dup(a,b) Perl_parser_dup(aTHX_ a,b)
#endif
Perl_gp_dup
Perl_mg_dup
Perl_sv_dup
+Perl_sv_dup_inc
Perl_rvpv_dup
Perl_parser_dup
Perl_ptr_table_new
char *k;
Newx(k, HEK_BASESIZE + sizeof(const SV *), char);
HeKEY_hek(ret) = (HEK*)k;
- HeKEY_sv(ret) = SvREFCNT_inc(sv_dup(HeKEY_sv(e), param));
+ HeKEY_sv(ret) = sv_dup_inc(HeKEY_sv(e), param);
}
else if (shared) {
/* This is hek_dup inlined, which seems to be important for speed
else
HeKEY_hek(ret) = save_hek_flags(HeKEY(e), HeKLEN(e), HeHASH(e),
HeKFLAGS(e));
- HeVAL(ret) = SvREFCNT_inc(sv_dup(HeVAL(e), param));
+ HeVAL(ret) = sv_dup_inc(HeVAL(e), param);
return ret;
}
#endif /* USE_ITHREADS */
if (newmeta->mro_linear_all) {
newmeta->mro_linear_all
- = MUTABLE_HV(SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_linear_all, param)));
+ = MUTABLE_HV(sv_dup_inc((const SV *)newmeta->mro_linear_all, param));
/* This is just acting as a shortcut pointer, and will be automatically
updated on the first get. */
newmeta->mro_linear_current = NULL;
} else if (newmeta->mro_linear_current) {
/* Only the current MRO is stored, so this owns the data. */
newmeta->mro_linear_current
- = SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_linear_current,
- param));
+ = sv_dup_inc((const SV *)newmeta->mro_linear_current, param);
}
if (newmeta->mro_nextmethod)
newmeta->mro_nextmethod
- = MUTABLE_HV(SvREFCNT_inc(sv_dup((const SV *)newmeta->mro_nextmethod, param)));
+ = MUTABLE_HV(sv_dup_inc((const SV *)newmeta->mro_nextmethod, param));
if (newmeta->isa)
newmeta->isa
- = MUTABLE_HV(SvREFCNT_inc(sv_dup((const SV *)newmeta->isa, param)));
+ = MUTABLE_HV(sv_dup_inc((const SV *)newmeta->isa, param));
return newmeta;
}
#define PERL_ARGS_ASSERT_SV_DUP \
assert(param)
+PERL_CALLCONV SV* Perl_sv_dup_inc(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_SV_DUP_INC \
+ assert(param)
+
PERL_CALLCONV void Perl_rvpv_dup(pTHX_ SV *const dstr, const SV *const sstr, CLONE_PARAMS *const param)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2)
Safefree(ri);
}
-#define sv_dup_inc(s,t) SvREFCNT_inc(sv_dup(s,t))
-#define av_dup_inc(s,t) MUTABLE_AV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
-#define hv_dup_inc(s,t) MUTABLE_HV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define av_dup_inc(s,t) MUTABLE_AV(sv_dup_inc((const SV *)s,t))
+#define hv_dup_inc(s,t) MUTABLE_HV(sv_dup_inc((const SV *)s,t))
#define SAVEPVN(p,n) ((p) ? savepvn(p,n) : NULL)
/*
that currently av_dup, gv_dup and hv_dup are the same as sv_dup.
If this changes, please unmerge ss_dup.
Likewise, sv_dup_inc_multiple() relies on this fact. */
-#define sv_dup_inc(s,t) SvREFCNT_inc(sv_dup(s,t))
-#define sv_dup_inc_NN(s,t) SvREFCNT_inc_NN(sv_dup(s,t))
+#define sv_dup_inc_NN(s,t) SvREFCNT_inc_NN(sv_dup_inc(s,t))
#define av_dup(s,t) MUTABLE_AV(sv_dup((const SV *)s,t))
-#define av_dup_inc(s,t) MUTABLE_AV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define av_dup_inc(s,t) MUTABLE_AV(sv_dup_inc((const SV *)s,t))
#define hv_dup(s,t) MUTABLE_HV(sv_dup((const SV *)s,t))
-#define hv_dup_inc(s,t) MUTABLE_HV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define hv_dup_inc(s,t) MUTABLE_HV(sv_dup_inc((const SV *)s,t))
#define cv_dup(s,t) MUTABLE_CV(sv_dup((const SV *)s,t))
-#define cv_dup_inc(s,t) MUTABLE_CV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define cv_dup_inc(s,t) MUTABLE_CV(sv_dup_inc((const SV *)s,t))
#define io_dup(s,t) MUTABLE_IO(sv_dup((const SV *)s,t))
-#define io_dup_inc(s,t) MUTABLE_IO(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define io_dup_inc(s,t) MUTABLE_IO(sv_dup_inc((const SV *)s,t))
#define gv_dup(s,t) MUTABLE_GV(sv_dup((const SV *)s,t))
-#define gv_dup_inc(s,t) MUTABLE_GV(SvREFCNT_inc(sv_dup((const SV *)s,t)))
+#define gv_dup_inc(s,t) MUTABLE_GV(sv_dup_inc((const SV *)s,t))
#define SAVEPV(p) ((p) ? savepv(p) : NULL)
#define SAVEPVN(p,n) ((p) ? savepvn(p,n) : NULL)
return dstr;
}
+SV *
+Perl_sv_dup_inc(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
+{
+ PERL_ARGS_ASSERT_SV_DUP_INC;
+ return SvREFCNT_inc(sv_dup(sstr,param));
+}
+
/* duplicate a context */
PERL_CONTEXT *