From: Nicholas Clark Date: Sun, 30 Oct 2005 18:31:25 +0000 (+0000) Subject: Given that sv_nosharing performs the same function as sv_nolocking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5b2b27b99d4ad8d4eeda4a420182b7cb89461aa;p=p5sagit%2Fp5-mst-13.2.git Given that sv_nosharing performs the same function as sv_nolocking and sv_unnolocking (ie sweet FA), we might as well use the 1 function to initialise all 3 variables, and elimiate the other two. For some reason all 3 are listed as being in the public API. Daft. p4raw-id: //depot/perl@25906 --- diff --git a/embed.fnc b/embed.fnc index 0d6bce4..a2e8eb3 100644 --- a/embed.fnc +++ b/embed.fnc @@ -988,8 +988,8 @@ pMX |int |sv_release_IVX |NN SV *sv #endif Adp |void |sv_nosharing |NULLOK SV * -Adp |void |sv_nolocking |NULLOK SV * -Adp |void |sv_nounlocking |NULLOK SV * +Adpbm |void |sv_nolocking |NULLOK SV * +Adpbm |void |sv_nounlocking |NULLOK SV * Adp |int |nothreadhook END_EXTERN_C diff --git a/embed.h b/embed.h index bc1b068..aa85b16 100644 --- a/embed.h +++ b/embed.h @@ -1009,8 +1009,6 @@ #endif #endif #define sv_nosharing Perl_sv_nosharing -#define sv_nolocking Perl_sv_nolocking -#define sv_nounlocking Perl_sv_nounlocking #define nothreadhook Perl_nothreadhook #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE @@ -2982,8 +2980,6 @@ #endif #endif #define sv_nosharing(a) Perl_sv_nosharing(aTHX_ a) -#define sv_nolocking(a) Perl_sv_nolocking(aTHX_ a) -#define sv_nounlocking(a) Perl_sv_nounlocking(aTHX_ a) #define nothreadhook() Perl_nothreadhook(aTHX) #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE diff --git a/intrpvar.h b/intrpvar.h index 966c7b7..7f6d21f 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -508,8 +508,8 @@ PERLVAR(Ireentrant_retint, int) /* Integer return value from reentrant functions /* Hooks to shared SVs and locks. */ PERLVARI(Isharehook, share_proc_t, MEMBER_TO_FPTR(Perl_sv_nosharing)) -PERLVARI(Ilockhook, share_proc_t, MEMBER_TO_FPTR(Perl_sv_nolocking)) -PERLVARI(Iunlockhook, share_proc_t, MEMBER_TO_FPTR(Perl_sv_nounlocking)) +PERLVARI(Ilockhook, share_proc_t, MEMBER_TO_FPTR(Perl_sv_nosharing)) +PERLVARI(Iunlockhook, share_proc_t, MEMBER_TO_FPTR(Perl_sv_nosharing)) PERLVARI(Ithreadhook, thrhook_proc_t, MEMBER_TO_FPTR(Perl_nothreadhook)) /* Force inclusion of both runops options */ diff --git a/mathoms.c b/mathoms.c index d8a84b5..be61f8e 100644 --- a/mathoms.c +++ b/mathoms.c @@ -795,6 +795,43 @@ Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep) } /* +=for apidoc sv_nolocking + +Dummy routine which "locks" an SV when there is no locking module present. +Exists to avoid test for a NULL function pointer and because it could +potentially warn under some level of strict-ness. + +"Superseded" by sv_nosharing(). + +=cut +*/ + +void +Perl_sv_nolocking(pTHX_ SV *sv) +{ + PERL_UNUSED_ARG(sv); +} + + +/* +=for apidoc sv_nounlocking + +Dummy routine which "unlocks" an SV when there is no locking module present. +Exists to avoid test for a NULL function pointer and because it could +potentially warn under some level of strict-ness. + +"Superseded" by sv_nosharing(). + +=cut +*/ + +void +Perl_sv_nounlocking(pTHX_ SV *sv) +{ + PERL_UNUSED_ARG(sv); +} + +/* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 diff --git a/proto.h b/proto.h index 65a23ca..fe65757 100644 --- a/proto.h +++ b/proto.h @@ -2766,8 +2766,8 @@ PERL_CALLCONV int Perl_sv_release_IVX(pTHX_ SV *sv) #endif PERL_CALLCONV void Perl_sv_nosharing(pTHX_ SV *); -PERL_CALLCONV void Perl_sv_nolocking(pTHX_ SV *); -PERL_CALLCONV void Perl_sv_nounlocking(pTHX_ SV *); +/* PERL_CALLCONV void Perl_sv_nolocking(pTHX_ SV *); */ +/* PERL_CALLCONV void Perl_sv_nounlocking(pTHX_ SV *); */ PERL_CALLCONV int Perl_nothreadhook(pTHX); END_EXTERN_C diff --git a/util.c b/util.c index 114f433..76ca325 100644 --- a/util.c +++ b/util.c @@ -4736,8 +4736,9 @@ Perl_my_socketpair (int family, int type, int protocol, int fd[2]) { =for apidoc sv_nosharing Dummy routine which "shares" an SV when there is no sharing module present. -Exists to avoid test for a NULL function pointer and because it could potentially warn under -some level of strict-ness. +Or "locks" it. Or "unlocks" it. In other words, ignores its single SV argument. +Exists to avoid test for a NULL function pointer and because it could +potentially warn under some level of strict-ness. =cut */ @@ -4748,39 +4749,6 @@ Perl_sv_nosharing(pTHX_ SV *sv) PERL_UNUSED_ARG(sv); } -/* -=for apidoc sv_nolocking - -Dummy routine which "locks" an SV when there is no locking module present. -Exists to avoid test for a NULL function pointer and because it could potentially warn under -some level of strict-ness. - -=cut -*/ - -void -Perl_sv_nolocking(pTHX_ SV *sv) -{ - PERL_UNUSED_ARG(sv); -} - - -/* -=for apidoc sv_nounlocking - -Dummy routine which "unlocks" an SV when there is no locking module present. -Exists to avoid test for a NULL function pointer and because it could potentially warn under -some level of strict-ness. - -=cut -*/ - -void -Perl_sv_nounlocking(pTHX_ SV *sv) -{ - PERL_UNUSED_ARG(sv); -} - U32 Perl_parse_unicode_opts(pTHX_ const char **popt) {