Make Storable work with blead/maint by making PL_sv_placeholder
Jarkko Hietaniemi [Mon, 28 Jul 2003 12:13:24 +0000 (12:13 +0000)]
a true global, bump $VERSION to 2.08.  Will take a look at the
portability issue of placeholders soon.

p4raw-id: //depot/perl@20263

embedvar.h
ext/Storable/Storable.pm
ext/Storable/Storable.xs
intrpvar.h
perlapi.h
perlvars.h
sv.c

index 2fe4840..21d166c 100644 (file)
 #define PL_sv_count            (vTHX->Isv_count)
 #define PL_sv_no               (vTHX->Isv_no)
 #define PL_sv_objcount         (vTHX->Isv_objcount)
-#define PL_sv_placeholder      (vTHX->Isv_placeholder)
 #define PL_sv_root             (vTHX->Isv_root)
 #define PL_sv_undef            (vTHX->Isv_undef)
 #define PL_sv_yes              (vTHX->Isv_yes)
 #define PL_Isv_count           PL_sv_count
 #define PL_Isv_no              PL_sv_no
 #define PL_Isv_objcount                PL_sv_objcount
-#define PL_Isv_placeholder     PL_sv_placeholder
 #define PL_Isv_root            PL_sv_root
 #define PL_Isv_undef           PL_sv_undef
 #define PL_Isv_yes             PL_sv_yes
 #define PL_patleave            (PL_Vars.Gpatleave)
 #define PL_sh_path             (PL_Vars.Gsh_path)
 #define PL_sigfpe_saved                (PL_Vars.Gsigfpe_saved)
+#define PL_sv_placeholder      (PL_Vars.Gsv_placeholder)
 #define PL_thr_key             (PL_Vars.Gthr_key)
 
 #else /* !PERL_GLOBAL_STRUCT */
 #define PL_Gpatleave           PL_patleave
 #define PL_Gsh_path            PL_sh_path
 #define PL_Gsigfpe_saved       PL_sigfpe_saved
+#define PL_Gsv_placeholder     PL_sv_placeholder
 #define PL_Gthr_key            PL_thr_key
 
 #endif /* PERL_GLOBAL_STRUCT */
index e1a72f6..81c94c8 100644 (file)
@@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter DynaLoader);
 use AutoLoader;
 use vars qw($canonical $forgive_me $VERSION);
 
-$VERSION = '2.07';
+$VERSION = '2.08';
 *AUTOLOAD = \&AutoLoader::AUTOLOAD;            # Grrr...
 
 #
index 055aefc..e344700 100644 (file)
@@ -2208,11 +2208,7 @@ static int store_hash(stcxt_t *cxt, HV *hv)
                             = (((hash_flags & SHV_RESTRICTED)
                                 && SvREADONLY(val))
                                ? SHV_K_LOCKED : 0);
-#ifdef PL_sv_placeholder
                         if (val == &PL_sv_placeholder)
-#else
-                        if (val == &PL_sv_undef)
-#endif
                             flags |= SHV_K_PLACEHOLDER;
 
                        keyval = SvPV(key, keylen_tmp);
@@ -2308,11 +2304,7 @@ static int store_hash(stcxt_t *cxt, HV *hv)
                             = (((hash_flags & SHV_RESTRICTED)
                                 && SvREADONLY(val))
                                              ? SHV_K_LOCKED : 0);
-#ifdef PL_sv_placeholder
                         if (val == &PL_sv_placeholder)
-#else
-                        if (val == &PL_sv_undef)
-#endif
                             flags |= SHV_K_PLACEHOLDER;
 
                         hek = HeKEY_hek(he);
index dbb9a12..6a34ea4 100644 (file)
@@ -531,9 +531,6 @@ PERLVAR(IDBassertion,   SV *)
 
 PERLVARI(Icv_has_eval, I32, 0) /* PL_compcv includes an entereval or similar */
 
-/* Restricted hashes placeholder value */
-PERLVAR(Isv_placeholder, SV)
-
 /* New variables must be added to the very end, before this comment,
  * for binary compatibility (the offsets of the old members must not change).
  * (Don't forget to add your variable also to perl_clone()!)
index 9af1ede..4782b32 100644 (file)
--- a/perlapi.h
+++ b/perlapi.h
@@ -550,8 +550,6 @@ END_EXTERN_C
 #define PL_sv_no               (*Perl_Isv_no_ptr(aTHX))
 #undef  PL_sv_objcount
 #define PL_sv_objcount         (*Perl_Isv_objcount_ptr(aTHX))
-#undef  PL_sv_placeholder
-#define PL_sv_placeholder      (*Perl_Isv_placeholder_ptr(aTHX))
 #undef  PL_sv_root
 #define PL_sv_root             (*Perl_Isv_root_ptr(aTHX))
 #undef  PL_sv_undef
@@ -950,6 +948,8 @@ END_EXTERN_C
 #define PL_sh_path             (*Perl_Gsh_path_ptr(NULL))
 #undef  PL_sigfpe_saved
 #define PL_sigfpe_saved                (*Perl_Gsigfpe_saved_ptr(NULL))
+#undef  PL_sv_placeholder
+#define PL_sv_placeholder      (*Perl_Gsv_placeholder_ptr(NULL))
 #undef  PL_thr_key
 #define PL_thr_key             (*Perl_Gthr_key_ptr(NULL))
 
index 0811399..83124d8 100644 (file)
@@ -59,3 +59,7 @@ PERLVARI(Gsh_path,    char *, SH_PATH)/* full path of shell */
  * See perl.h macros PERL_FPU_INIT and PERL_FPU_{PRE,POST}_EXEC. */
 PERLVAR(Gsigfpe_saved, Sighandler_t)
 
+/* Restricted hashes placeholder value.
+ * The contents are never used, only the address. */
+PERLVAR(Gsv_placeholder, SV)
+
diff --git a/sv.c b/sv.c
index 45d09d0..c31ada7 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10913,11 +10913,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     SvNVX(&PL_sv_yes)          = 1;
     ptr_table_store(PL_ptr_table, &proto_perl->Isv_yes, &PL_sv_yes);
 
-    SvANY(&PL_sv_placeholder)  = NULL;
-    SvREFCNT(&PL_sv_placeholder)= (~(U32)0)/2;
-    SvFLAGS(&PL_sv_placeholder)        = SVf_READONLY|SVt_NULL;
-    ptr_table_store(PL_ptr_table, &proto_perl->Isv_placeholder, &PL_sv_placeholder);
-
     /* create (a non-shared!) shared string table */
     PL_strtab          = newHV();
     HvSHAREKEYS_off(PL_strtab);