From 27669aa412f62d9967b069ba672cd20239c354c1 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 18 Aug 2012 12:34:33 -0700 Subject: Use static inline functions for SvREFCNT_inc This avoids the need to repeat the macros in GCC and non-GCC versions. For non-GCC compilers capable of inlining, this should speed things up slightly, too, as PL_Sv is no longer needed. --- inline.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'inline.h') diff --git a/inline.h b/inline.h index 608f6c4b2a..cdcaf04a8f 100644 --- a/inline.h +++ b/inline.h @@ -11,3 +11,25 @@ * * Each section names the header file that the functions "belong" to. */ + +/* ------------------------------- sv.h ------------------------------- */ + +PERL_STATIC_INLINE SV * +S_SvREFCNT_inc(SV *sv) +{ + if (sv) + SvREFCNT(sv)++; + return sv; +} +PERL_STATIC_INLINE SV * +S_SvREFCNT_inc_NN(SV *sv) +{ + SvREFCNT(sv)++; + return sv; +} +PERL_STATIC_INLINE void +S_SvREFCNT_inc_void(SV *sv) +{ + if (sv) + SvREFCNT(sv)++; +} -- cgit v1.2.1