Replace sv_unref with a macro that calls sv_unref_flags
authorNicholas Clark <nick@ccl4.org>
Sat, 29 Oct 2005 14:39:37 +0000 (14:39 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 29 Oct 2005 14:39:37 +0000 (14:39 +0000)
p4raw-id: //depot/perl@25878

embed.fnc
embed.h
mathoms.c
proto.h
sv.c
sv.h

index 9adba98..c4c8587 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -814,7 +814,7 @@ Amdb        |void   |sv_setsv       |NN SV* dsv|NULLOK SV* ssv
 Amdb   |void   |sv_taint       |NN SV* sv
 ApdR   |bool   |sv_tainted     |NN SV* sv
 Apd    |int    |sv_unmagic     |NN SV* sv|int type
-Apd    |void   |sv_unref       |NN SV* sv
+Apdmb  |void   |sv_unref       |NN SV* sv
 Apd    |void   |sv_unref_flags |NN SV* sv|U32 flags
 Apd    |void   |sv_untaint     |NN SV* sv
 Apd    |void   |sv_upgrade     |NN SV* sv|U32 mt
diff --git a/embed.h b/embed.h
index c383dc8..f99bc5b 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define sv_setpvn              Perl_sv_setpvn
 #define sv_tainted             Perl_sv_tainted
 #define sv_unmagic             Perl_sv_unmagic
-#define sv_unref               Perl_sv_unref
 #define sv_unref_flags         Perl_sv_unref_flags
 #define sv_untaint             Perl_sv_untaint
 #define sv_upgrade             Perl_sv_upgrade
 #define sv_setpvn(a,b,c)       Perl_sv_setpvn(aTHX_ a,b,c)
 #define sv_tainted(a)          Perl_sv_tainted(aTHX_ a)
 #define sv_unmagic(a,b)                Perl_sv_unmagic(aTHX_ a,b)
-#define sv_unref(a)            Perl_sv_unref(aTHX_ a)
 #define sv_unref_flags(a,b)    Perl_sv_unref_flags(aTHX_ a,b)
 #define sv_untaint(a)          Perl_sv_untaint(aTHX_ a)
 #define sv_upgrade(a,b)                Perl_sv_upgrade(aTHX_ a,b)
index f165ba4..04cff18 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -37,6 +37,23 @@ Perl_ref(pTHX_ OP *o, I32 type)
 }
 
 /*
+=for apidoc sv_unref
+
+Unsets the RV status of the SV, and decrements the reference count of
+whatever was being referenced by the RV.  This can almost be thought of
+as a reversal of C<newSVrv>.  This is C<sv_unref_flags> with the C<flag>
+being zero.  See C<SvROK_off>.
+
+=cut
+*/
+
+void
+Perl_sv_unref(pTHX_ SV *sv)
+{
+    sv_unref_flags(sv, 0);
+}
+
+/*
 =for apidoc sv_taint
 
 Taint an SV. Use C<SvTAINTED_on> instead.
diff --git a/proto.h b/proto.h
index fd92ce3..f5914c9 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2258,8 +2258,8 @@ PERL_CALLCONV bool        Perl_sv_tainted(pTHX_ SV* sv)
 PERL_CALLCONV int      Perl_sv_unmagic(pTHX_ SV* sv, int type)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV void     Perl_sv_unref(pTHX_ SV* sv)
-                       __attribute__nonnull__(pTHX_1);
+/* PERL_CALLCONV void  Perl_sv_unref(pTHX_ SV* sv)
+                       __attribute__nonnull__(pTHX_1); */
 
 PERL_CALLCONV void     Perl_sv_unref_flags(pTHX_ SV* sv, U32 flags)
                        __attribute__nonnull__(pTHX_1);
diff --git a/sv.c b/sv.c
index a15149c..9b863ce 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -8319,23 +8319,6 @@ Perl_sv_unref_flags(pTHX_ SV *ref, U32 flags)
 }
 
 /*
-=for apidoc sv_unref
-
-Unsets the RV status of the SV, and decrements the reference count of
-whatever was being referenced by the RV.  This can almost be thought of
-as a reversal of C<newSVrv>.  This is C<sv_unref_flags> with the C<flag>
-being zero.  See C<SvROK_off>.
-
-=cut
-*/
-
-void
-Perl_sv_unref(pTHX_ SV *sv)
-{
-    sv_unref_flags(sv, 0);
-}
-
-/*
 =for apidoc sv_untaint
 
 Untaint an SV. Use C<SvTAINTED_off> instead.
diff --git a/sv.h b/sv.h
index 0fff609..8dbbcb2 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1349,6 +1349,8 @@ Like C<sv_catsv> but doesn't process magic.
 #define SV_CONST_RETURN                32
 #define SV_MUTABLE_RETURN      64
 
+#define sv_unref(sv)    sv_unref_flags(sv, 0)
+
 /* We are about to replace the SV's current value. So if it's copy on write
    we need to normalise it. Use the SV_COW_DROP_PV flag hint to say that
    the value is about to get thrown away, so drop the PV rather than go to