Skip to content
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

Add a PadnameREFCNT_inc() macro #20107

Merged
merged 1 commit into from Aug 17, 2022
Merged

Conversation

leonerd
Copy link
Contributor

@leonerd leonerd commented Aug 17, 2022

Implemented as a static inline function call, so that it can return the padname pointer itself. This would allow use in expressions such as

ptr->field = PadnameREFCNT_inc(pn);

That makes it similar to the familiar SvREFCNT_inc() macro.

@ilmari ilmari self-requested a review August 17, 2022 13:15
Implemented as a static inline function call, so that it can return the
padname pointer itself.  This would allow use in expressions such as

  ptr->field = PadnameREFCNT_inc(pn);

That makes it similar to the familiar SvREFCNT_inc() macro.
@@ -3430,6 +3430,13 @@ Perl_cop_file_avn(pTHX_ const COP *cop) {

#endif

PERL_STATIC_INLINE PADNAME *
Perl_padname_refcnt_inc(PADNAME *pn)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sudden wondering whether this should be named S_ instead of Perl_, as it's only here to make one of the macros work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh; most of the rest of them are Perl_... and those seem fine. I'll leave it as is.

@leonerd leonerd merged commit 79277e9 into Perl:blead Aug 17, 2022
@leonerd leonerd deleted the PadnameREFCNT_inc branch August 17, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants