#endif
PERL_STATIC_INLINE char *
+Perl_sv_pvutf8n_force_wrapper(pTHX_ SV * const sv, STRLEN * const lp, const U32 dummy)
+{
+ /* This is just so can be passed to Perl_SvPV_helper() as a function
+ * pointer with the same signature as all the other such pointers, and
+ * having hence an unused parameter */
+ PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE_WRAPPER;
+ PERL_UNUSED_ARG(dummy);
+
+ return sv_pvutf8n_force(sv, lp);
+}
+
+PERL_STATIC_INLINE char *
+Perl_sv_pvbyten_force_wrapper(pTHX_ SV * const sv, STRLEN * const lp, const U32 dummy)
+{
+ /* This is just so can be passed to Perl_SvPV_helper() as a function
+ * pointer with the same signature as all the other such pointers, and
+ * having hence an unused parameter */
+ PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE_WRAPPER;
+ PERL_UNUSED_ARG(dummy);
+
+ return sv_pvbyten_force(sv, lp);
+}
+
+PERL_STATIC_INLINE char *
Perl_SvPV_helper(pTHX_
SV * const sv,
STRLEN * const lp,
return non_trivial(aTHX_ sv, lp, (flags|return_flags));
}
-PERL_STATIC_INLINE char *
-Perl_sv_pvutf8n_force_wrapper(pTHX_ SV * const sv, STRLEN * const lp, const U32 dummy)
-{
- /* This is just so can be passed to Perl_SvPV_helper() as a function
- * pointer with the same signature as all the other such pointers, and
- * having hence an unused parameter */
- PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE_WRAPPER;
- PERL_UNUSED_ARG(dummy);
+/*
+=for apidoc newRV_noinc
- return sv_pvutf8n_force(sv, lp);
-}
+Creates an RV wrapper for an SV. The reference count for the original
+SV is B<not> incremented.
-PERL_STATIC_INLINE char *
-Perl_sv_pvbyten_force_wrapper(pTHX_ SV * const sv, STRLEN * const lp, const U32 dummy)
+=cut
+*/
+
+PERL_STATIC_INLINE SV *
+Perl_newRV_noinc(pTHX_ SV *const tmpRef)
{
- /* This is just so can be passed to Perl_SvPV_helper() as a function
- * pointer with the same signature as all the other such pointers, and
- * having hence an unused parameter */
- PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE_WRAPPER;
- PERL_UNUSED_ARG(dummy);
+ SV *sv = newSV_type(SVt_IV);
- return sv_pvbyten_force(sv, lp);
+ PERL_ARGS_ASSERT_NEWRV_NOINC;
+
+ SvTEMP_off(tmpRef);
+
+ /* inlined, simplified sv_setrv_noinc(sv, tmpRef); */
+ SvRV_set(sv, tmpRef);
+ SvROK_on(sv);
+
+ return sv;
}
/*