From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Fri, 14 Jul 2006 09:34:09 +0000 (+0300)
Subject: -DPERL_GLOBAL_STRUCT_PRIVATE tweaks (done_sanity_check global? yech!)
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b2d3faa276ad12850b3d1cb417e36a43029c4ec;p=p5sagit%2Fp5-mst-13.2.git

-DPERL_GLOBAL_STRUCT_PRIVATE tweaks (done_sanity_check global? yech!)
Message-Id: <200607140634.k6E6Y9Ia471707@kosh.hut.fi>

p4raw-id: //depot/perl@28570
---

diff --git a/hv.c b/hv.c
index 4f55cca..c3a4188 100644
--- a/hv.c
+++ b/hv.c
@@ -2577,6 +2577,7 @@ Perl_hv_placeholders_set(pTHX_ HV *hv, I32 ph)
 SV *
 S_refcounted_he_value(pTHX_ const struct refcounted_he *he)
 {
+    dVAR;
     SV *value;
     switch(he->refcounted_he_data[0] & HVrhek_typemask) {
     case HVrhek_undef:
@@ -2728,6 +2729,7 @@ SV *
 Perl_refcounted_he_fetch(pTHX_ const struct refcounted_he *chain, SV *keysv,
 			 const char *key, STRLEN klen, int flags, U32 hash)
 {
+    dVAR;
     /* Just to be awkward, if you're using this interface the UTF-8-or-not-ness
        of your key has to exactly match that which is stored.  */
     SV *value = &PL_sv_placeholder;
diff --git a/sv.c b/sv.c
index fa576b2..f2ad6d5 100644
--- a/sv.c
+++ b/sv.c
@@ -1032,7 +1032,7 @@ static const struct body_details bodies_by_type[] = {
 #define new_NOARENAZ(details) \
 	my_safecalloc((details)->body_size + (details)->offset)
 
-#ifdef DEBUGGING
+#if defined(DEBUGGING) && !defined(PERL_GLOBAL_STRUCT_PRIVATE)
 static bool done_sanity_check;
 #endif
 
@@ -1048,7 +1048,9 @@ S_more_bodies (pTHX_ svtype sv_type)
 
     assert(bdp->arena_size);
 
-#ifdef DEBUGGING
+#if defined(DEBUGGING) && !defined(PERL_GLOBAL_STRUCT_PRIVATE)
+    /* PERL_GLOBAL_STRUCT_PRIVATE cannot coexist with global
+     * variables like done_sanity_check. */
     if (!done_sanity_check) {
 	unsigned int i = SVt_LAST;