Skip to content

Commit

Permalink
S_new_SV: mark args unused, make inline, rename with Perl_ prefix
Browse files Browse the repository at this point in the history
When sv_inline.h was created in
Perl@75acd14
and a number of things moved into it, the S_new_SV debugging function should
have been made PERL_STATIC_INLINE and given the Perl_ prefix. This commit
now does those things. It also marks the arguments to Perl_new_SV as
PERL_UNUSED_ARG, reducing warnings on some builds.
  • Loading branch information
richardleach committed May 13, 2024
1 parent 8cacb84 commit 1c16f24
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sv_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ SV* Perl_more_sv(pTHX);

#ifdef DEBUG_LEAKING_SCALARS
/* provide a real function for a debugger to play with */
STATIC SV*
S_new_SV(pTHX_ const char *file, int line, const char *func)
PERL_STATIC_INLINE SV*
Perl_new_SV(pTHX_ const char *file, int line, const char *func)
{
SV* sv;
PERL_UNUSED_ARG(file);
PERL_UNUSED_ARG(line);
PERL_UNUSED_ARG(func);

if (PL_sv_root)
uproot_SV(sv);
Expand Down Expand Up @@ -102,7 +105,7 @@ S_new_SV(pTHX_ const char *file, int line, const char *func)

return sv;
}
# define new_SV(p) (p)=S_new_SV(aTHX_ __FILE__, __LINE__, FUNCTION__)
# define new_SV(p) (p)=Perl_new_SV(aTHX_ __FILE__, __LINE__, FUNCTION__)

#else
# define new_SV(p) \
Expand Down

0 comments on commit 1c16f24

Please sign in to comment.