Skip to content

Force SvPV_helper to be always inline #23571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions sv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading