summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2006-05-21 22:34:29 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2006-05-21 22:34:29 +0000
commite638c62455531365fde53d9d25a44d20ac62f598 (patch)
tree29eb91f43e752a208de8d86820a30ca03252f460 /sv.h
parent1c12ffb434b4a9bffc733e04581e76608fc7c846 (diff)
downloadperl-e638c62455531365fde53d9d25a44d20ac62f598.tar.gz
Remove duplicate documentation for SvREFCNT_inc().
Add documentation for SvREFCNT_inc_simple_void_NN(). Wrap SvREFCNT_inc_simple_void() in STMT_START/STMT_END. p4raw-id: //depot/perl@28266
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sv.h b/sv.h
index f89df26bc7..fe92bc3a22 100644
--- a/sv.h
+++ b/sv.h
@@ -182,8 +182,11 @@ and smaller.
Same as SvREFCNT_inc_simple, but can only be used if you don't need the
return value. The macro doesn't need to return a meaningful value.
-=for apidoc Am|SV*|SvREFCNT_inc|SV* sv
-Increments the reference count of the given SV.
+=for apidoc Am|SV*|SvREFCNT_inc_simple_void_NN|SV* sv
+Same as SvREFCNT_inc, but can only be used if you don't need the return
+value, and you know that I<sv> is not NULL. The macro doesn't need
+to return a meaningful value, or check for NULLness, so it's smaller
+and faster.
=for apidoc Am|void|SvREFCNT_dec|SV* sv
Decrements the reference count of the given SV.
@@ -240,7 +243,7 @@ perform the upgrade if necessary. See C<svtype>.
#endif
/* These guys don't need the curly blocks */
-#define SvREFCNT_inc_simple_void(sv) if (sv) (SvREFCNT(sv)++);
+#define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
#define SvREFCNT_inc_simple_NN(sv) (++(SvREFCNT(sv)),(SV*)(sv))
#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))