Make sharepvn a macro since all it does is a deref.
Jarkko Hietaniemi [Mon, 3 Dec 2001 14:03:21 +0000 (14:03 +0000)]
p4raw-id: //depot/perl@13436

embed.h
embed.pl
global.sym
hv.c
hv.h
proto.h

diff --git a/embed.h b/embed.h
index ca01a8d..3a82bc7 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define setenv_getix           Perl_setenv_getix
 #endif
 #define setdefout              Perl_setdefout
-#define sharepvn               Perl_sharepvn
 #define share_hek              Perl_share_hek
 #define sighandler             Perl_sighandler
 #define stack_grow             Perl_stack_grow
 #define setenv_getix(a)                Perl_setenv_getix(aTHX_ a)
 #endif
 #define setdefout(a)           Perl_setdefout(aTHX_ a)
-#define sharepvn(a,b,c)                Perl_sharepvn(aTHX_ a,b,c)
 #define share_hek(a,b,c)       Perl_share_hek(aTHX_ a,b,c)
 #define sighandler             Perl_sighandler
 #define stack_grow(a,b,c)      Perl_stack_grow(aTHX_ a,b,c)
index 5e9a8b2..629772a 100755 (executable)
--- a/embed.pl
+++ b/embed.pl
@@ -1714,7 +1714,6 @@ Ap        |char*  |screaminstr    |SV* bigsv|SV* littlesv|I32 start_shift \
 p      |I32    |setenv_getix   |char* nam
 #endif
 p      |void   |setdefout      |GV* gv
-Ap     |char*  |sharepvn       |const char* sv|I32 len|U32 hash
 p      |HEK*   |share_hek      |const char* sv|I32 len|U32 hash
 np     |Signal_t |sighandler   |int sig
 Ap     |SV**   |stack_grow     |SV** sp|SV**p|int n
index 802dd25..b2a9225 100644 (file)
@@ -174,6 +174,7 @@ Perl_is_uni_xdigit
 Perl_to_uni_upper
 Perl_to_uni_title
 Perl_to_uni_lower
+Perl_to_uni_fold
 Perl_is_uni_alnum_lc
 Perl_is_uni_alnumc_lc
 Perl_is_uni_idfirst_lc
@@ -387,7 +388,6 @@ Perl_scan_hex
 Perl_scan_num
 Perl_scan_oct
 Perl_screaminstr
-Perl_sharepvn
 Perl_stack_grow
 Perl_start_subparse
 Perl_sv_2bool
diff --git a/hv.c b/hv.c
index 11992f4..5d7b49f 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1640,12 +1640,16 @@ Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how)
     sv_magic((SV*)hv, (SV*)gv, how, Nullch, 0);
 }
 
+#if 0 /* use the macro from hv.h instead */
+
 char*  
 Perl_sharepvn(pTHX_ const char *sv, I32 len, U32 hash)
 {
     return HEK_KEY(share_hek(sv, len, hash));
 }
 
+#endif
+
 /* possibly free a shared string if no one has access to it
  * len and hash must both be valid for str.
  */
diff --git a/hv.h b/hv.h
index 9d6be7f..3475c87 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -197,3 +197,7 @@ C<SV*>.
                         ? (size) * sizeof(HE*)                         \
                         : (size) * sizeof(HE*) * 2 - MALLOC_OVERHEAD)
 #endif
+
+/* available as a function in hv.c */
+#define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
+#define sharepvn(sv, len, hash)             Perl_sharepvn(sv, len, hash)
diff --git a/proto.h b/proto.h
index 688af73..ebd00fd 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -693,7 +693,6 @@ PERL_CALLCONV char* Perl_screaminstr(pTHX_ SV* bigsv, SV* littlesv, I32 start_sh
 PERL_CALLCONV I32      Perl_setenv_getix(pTHX_ char* nam);
 #endif
 PERL_CALLCONV void     Perl_setdefout(pTHX_ GV* gv);
-PERL_CALLCONV char*    Perl_sharepvn(pTHX_ const char* sv, I32 len, U32 hash);
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* sv, I32 len, U32 hash);
 PERL_CALLCONV Signal_t Perl_sighandler(int sig);
 PERL_CALLCONV SV**     Perl_stack_grow(pTHX_ SV** sp, SV**p, int n);