From: Nicholas Clark Date: Sat, 29 Oct 2005 14:39:37 +0000 (+0000) Subject: Replace sv_unref with a macro that calls sv_unref_flags X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=174c73e345a053498d612e92802b2f52a87c26bc;p=p5sagit%2Fp5-mst-13.2.git Replace sv_unref with a macro that calls sv_unref_flags p4raw-id: //depot/perl@25878 --- diff --git a/embed.fnc b/embed.fnc index 9adba98..c4c8587 100644 --- 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 --- a/embed.h +++ b/embed.h @@ -855,7 +855,6 @@ #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 @@ -2848,7 +2847,6 @@ #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) diff --git a/mathoms.c b/mathoms.c index f165ba4..04cff18 100644 --- 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. This is C with the C +being zero. See C. + +=cut +*/ + +void +Perl_sv_unref(pTHX_ SV *sv) +{ + sv_unref_flags(sv, 0); +} + +/* =for apidoc sv_taint Taint an SV. Use C instead. diff --git a/proto.h b/proto.h index fd92ce3..f5914c9 100644 --- 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 --- 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. This is C with the C -being zero. See C. - -=cut -*/ - -void -Perl_sv_unref(pTHX_ SV *sv) -{ - sv_unref_flags(sv, 0); -} - -/* =for apidoc sv_untaint Untaint an SV. Use C instead. diff --git a/sv.h b/sv.h index 0fff609..8dbbcb2 100644 --- a/sv.h +++ b/sv.h @@ -1349,6 +1349,8 @@ Like C 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