summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-08-17 14:10:39 +0100
committerPaul Evans <leonerd@leonerd.org.uk>2022-08-17 15:59:15 +0100
commit79277e97f5c8cedf24a2686ea15b74abbc4b643a (patch)
treef9c7b194b404087d0118fe82ff95db50b32d749b /inline.h
parent22887b5bfa220f1de2e85d93f5387a8870cc1ae7 (diff)
downloadperl-79277e97f5c8cedf24a2686ea15b74abbc4b643a.tar.gz
Add a PadnameREFCNT_inc() macro
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.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/inline.h b/inline.h
index 3c9ef61fc5..76d52bee14 100644
--- a/inline.h
+++ b/inline.h
@@ -3430,6 +3430,13 @@ Perl_cop_file_avn(pTHX_ const COP *cop) {
#endif
+PERL_STATIC_INLINE PADNAME *
+Perl_padname_refcnt_inc(PADNAME *pn)
+{
+ PadnameREFCNT(pn)++;
+ return pn;
+}
+
/*
* ex: set ts=8 sts=4 sw=4 et:
*/