diff --git a/embed.fnc b/embed.fnc index aceb5014e14b..7c66585269be 100644 --- a/embed.fnc +++ b/embed.fnc @@ -3358,6 +3358,13 @@ CRdmp |char * |sv_2pvbyte_nolen \ Adp |char * |sv_2pv_flags |NN SV * const sv \ |NULLOK STRLEN * const lp \ |const U32 flags +CIp |char * |SvPV_helper |NN SV * const sv \ + |NN STRLEN * const lp \ + |const U32 flags \ + |const PL_SvPVtype type \ + |NN Perl_SvPV_helper_non_trivial_t non_trivial \ + |const bool or_null \ + |const U32 return_flags Cdmp |char * |sv_pvn_force |NN SV *sv \ |NULLOK STRLEN *lp Adp |char * |sv_pvn_force_flags \ diff --git a/embed.h b/embed.h index ae046a6173e8..9dd285c36018 100644 --- a/embed.h +++ b/embed.h @@ -109,6 +109,7 @@ # define SvNV(a) Perl_SvNV(aTHX_ a) # define SvNV_nomg(a) Perl_SvNV_nomg(aTHX_ a) # define SvPVXtrue(a) Perl_SvPVXtrue(aTHX_ a) +# define SvPV_helper(a,b,c,d,e,f,g) Perl_SvPV_helper(aTHX_ a,b,c,d,e,f,g) # define SvREFCNT_dec_ret_NULL(a) Perl_SvREFCNT_dec_ret_NULL(aTHX_ a) # define SvTRUE(a) Perl_SvTRUE(aTHX_ a) # define SvTRUE_NN(a) Perl_SvTRUE_NN(aTHX_ a) diff --git a/proto.h b/proto.h index 138d33b2b112..4bf2ee0ea1df 100644 --- a/proto.h +++ b/proto.h @@ -9680,6 +9680,12 @@ Perl_SvPVXtrue(pTHX_ SV *sv) # define PERL_ARGS_ASSERT_SVPVXTRUE \ assert(sv) +PERL_STATIC_FORCE_INLINE char * +Perl_SvPV_helper(pTHX_ SV * const sv, STRLEN * const lp, const U32 flags, const PL_SvPVtype type, Perl_SvPV_helper_non_trivial_t non_trivial, const bool or_null, const U32 return_flags) + __attribute__always_inline__; +# define PERL_ARGS_ASSERT_SVPV_HELPER \ + assert(sv); assert(lp); assert(non_trivial) + PERL_STATIC_INLINE void Perl_SvREFCNT_dec(pTHX_ SV *sv); # define PERL_ARGS_ASSERT_SVREFCNT_DEC diff --git a/sv.h b/sv.h index 181aedfb3173..708aa7dc0131 100644 --- a/sv.h +++ b/sv.h @@ -1958,16 +1958,8 @@ typedef enum { SvPVbyte_pure_type_ } PL_SvPVtype; -START_EXTERN_C - -/* When this code was written, embed.fnc could not handle function pointer - * parameters; perhaps it still can't */ -#ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE char* -Perl_SvPV_helper(pTHX_ SV *const sv, STRLEN *const lp, const U32 flags, const PL_SvPVtype type, char * (*non_trivial)(pTHX_ SV *, STRLEN * const, const U32), const bool or_null, const U32 return_flags); -#endif - -END_EXTERN_C +typedef char * (*Perl_SvPV_helper_non_trivial_t)(pTHX_ SV *, STRLEN * const, + const U32); /* This test is "is there a cached PV that we can use directly?" * We can if