-
Notifications
You must be signed in to change notification settings - Fork 555
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
S_new_SV: mark args unused, make inline, correct typo #22208
S_new_SV: mark args unused, make inline, correct typo #22208
Conversation
b3717a0
to
250be70
Compare
Something that I should have picked up from the original commit: S_new_SV() is visible outside of perl itself, and like the other visible inline functions it should use a Looks fine otherwise. |
250be70
to
1c16f24
Compare
I think S_new_SV() should be made always defined, not just existing on DEBUG_LEAKING_SCALARS builds; but with the extra sv->sv_debug* and logging lines wrapped in ifdef DEBUG_LEAKING_SCALARS. Then the macro new_SV() should stop being a multi-line macro and just become a call to the inline function S_new_SV(). Then the code comment "provide a real function for a debugger to play with" becomes redundant. The weird "sometimes a macro, sometimes a function" arrangement was put in place by me back before we could use inline functions. It should probably also have an entry in embed.fnc? |
Yes it should have an embed.fnc entry |
Ok, will work on that. |
1c16f24
to
fdbd16f
Compare
ddecdf3
to
ececbcf
Compare
The name defined in embed.fnc is You've also put the name in embed.fnc within a
You'll probably need to add an |
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. Additionally, now that we can use inline functions, the new_SV() macro is now just a call to this inline function, rather than being that only on DEBUG_LEAKING_SCALARS builds and a multi-line macro the rest of the time.
ececbcf
to
516f7c8
Compare
When sv_inline.h was created in
75acd14
and a number of things moved into it, the S_new_SV debugging function should
have been made PERL_STATIC_INLINE. This commit now does that.It also marks
the arguments to S_new_SV as PERL_UNUSED_ARG, reducing warnings on some
builds, and corrects a transcription error in the FUNCTION argument.
The first two changes were suggested in #22125 and the third noticed during
preparation of this PR.