This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cdcaf04a8f35a302f18c85b8a7c81da35794ab15
[perl5.git] / inline.h
1 /*    inline.h
2  *
3  *    Copyright (C) 2012 by Larry Wall and others
4  *
5  *    You may distribute under the terms of either the GNU General Public
6  *    License or the Artistic License, as specified in the README file.
7  *
8  * This file is a home for static inline functions that cannot go in other
9  * headers files, because they depend on proto.h (included after most other
10  * headers) or struct definitions.
11  *
12  * Each section names the header file that the functions "belong" to.
13  */
14
15 /* ------------------------------- sv.h ------------------------------- */
16
17 PERL_STATIC_INLINE SV *
18 S_SvREFCNT_inc(SV *sv)
19 {
20     if (sv)
21         SvREFCNT(sv)++;
22     return sv;
23 }
24 PERL_STATIC_INLINE SV *
25 S_SvREFCNT_inc_NN(SV *sv)
26 {
27     SvREFCNT(sv)++;
28     return sv;
29 }
30 PERL_STATIC_INLINE void
31 S_SvREFCNT_inc_void(SV *sv)
32 {
33     if (sv)
34         SvREFCNT(sv)++;
35 }