diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-18 12:34:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-21 16:38:35 -0700 |
commit | 27669aa412f62d9967b069ba672cd20239c354c1 (patch) | |
tree | 237c8ecdec51bac13edf069951da5a2afcbfdfc1 /inline.h | |
parent | 25468daabce05c6c76ace4055995f92d166fc9ff (diff) | |
download | perl-27669aa412f62d9967b069ba672cd20239c354c1.tar.gz |
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.
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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)++; +} |