From 79277e97f5c8cedf24a2686ea15b74abbc4b643a Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 17 Aug 2022 14:10:39 +0100 Subject: 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. --- inline.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inline.h') 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: */ -- cgit v1.2.1