This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PL_malloc_mutex needs to be global, not per-interpreter
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 17 Oct 1999 23:43:59 +0000 (23:43 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 17 Oct 1999 23:43:59 +0000 (23:43 +0000)
(malloc.c has static data)

p4raw-id: //depot/perl@4403

embedvar.h
intrpvar.h
objXSUB.h
perl.c
perlvars.h

index 22a970a..b018119 100644 (file)
 #define PL_main_cv             (PERL_GET_INTERP->Imain_cv)
 #define PL_main_root           (PERL_GET_INTERP->Imain_root)
 #define PL_main_start          (PERL_GET_INTERP->Imain_start)
-#define PL_malloc_mutex                (PERL_GET_INTERP->Imalloc_mutex)
 #define PL_max_intro_pending   (PERL_GET_INTERP->Imax_intro_pending)
 #define PL_maxo                        (PERL_GET_INTERP->Imaxo)
 #define PL_maxsysfd            (PERL_GET_INTERP->Imaxsysfd)
 #define PL_main_cv             (vTHX->Imain_cv)
 #define PL_main_root           (vTHX->Imain_root)
 #define PL_main_start          (vTHX->Imain_start)
-#define PL_malloc_mutex                (vTHX->Imalloc_mutex)
 #define PL_max_intro_pending   (vTHX->Imax_intro_pending)
 #define PL_maxo                        (vTHX->Imaxo)
 #define PL_maxsysfd            (vTHX->Imaxsysfd)
 #define PL_Imain_cv            PL_main_cv
 #define PL_Imain_root          PL_main_root
 #define PL_Imain_start         PL_main_start
-#define PL_Imalloc_mutex       PL_malloc_mutex
 #define PL_Imax_intro_pending  PL_max_intro_pending
 #define PL_Imaxo               PL_maxo
 #define PL_Imaxsysfd           PL_maxsysfd
 #define PL_curinterp           (PL_Vars.Gcurinterp)
 #define PL_do_undump           (PL_Vars.Gdo_undump)
 #define PL_hexdigit            (PL_Vars.Ghexdigit)
+#define PL_malloc_mutex                (PL_Vars.Gmalloc_mutex)
 #define PL_patleave            (PL_Vars.Gpatleave)
 
 #else /* !PERL_GLOBAL_STRUCT */
 #define PL_Gcurinterp          PL_curinterp
 #define PL_Gdo_undump          PL_do_undump
 #define PL_Ghexdigit           PL_hexdigit
+#define PL_Gmalloc_mutex       PL_malloc_mutex
 #define PL_Gpatleave           PL_patleave
 
 #endif /* PERL_GLOBAL_STRUCT */
index 1a8b1bf..a60620f 100644 (file)
@@ -369,7 +369,6 @@ PERLVAR(Ifilter_debug,      int)
 #ifdef USE_THREADS
 PERLVAR(Ithr_key,      perl_key)       /* For per-thread struct perl_thread* */
 PERLVAR(Isv_mutex,     perl_mutex)     /* Mutex for allocating SVs in sv.c */
-PERLVAR(Imalloc_mutex, perl_mutex)     /* Mutex for malloc */
 PERLVAR(Ieval_mutex,   perl_mutex)     /* Mutex for doeval */
 PERLVAR(Ieval_cond,    perl_cond)      /* Condition variable for doeval */
 PERLVAR(Ieval_owner,   struct perl_thread *)
index 9620006..fb8698b 100644 (file)
--- a/objXSUB.h
+++ b/objXSUB.h
 #define PL_main_root           (*Perl_Imain_root_ptr(aTHXo))
 #undef  PL_main_start
 #define PL_main_start          (*Perl_Imain_start_ptr(aTHXo))
-#undef  PL_malloc_mutex
-#define PL_malloc_mutex                (*Perl_Imalloc_mutex_ptr(aTHXo))
 #undef  PL_max_intro_pending
 #define PL_max_intro_pending   (*Perl_Imax_intro_pending_ptr(aTHXo))
 #undef  PL_maxo
 #define PL_do_undump           (*Perl_Gdo_undump_ptr(NULL))
 #undef  PL_hexdigit
 #define PL_hexdigit            (*Perl_Ghexdigit_ptr(NULL))
+#undef  PL_malloc_mutex
+#define PL_malloc_mutex                (*Perl_Gmalloc_mutex_ptr(NULL))
 #undef  PL_patleave
 #define PL_patleave            (*Perl_Gpatleave_ptr(NULL))
 
diff --git a/perl.c b/perl.c
index 6e9ffaa..23ece0f 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -811,7 +811,6 @@ S_parse_body(pTHX_ va_list args)
 #else
                sv_catpv(PL_Sv,"print \"\\nCharacteristics of this binary (from libperl): \\n\",");
 #endif
-#if defined(DEBUGGING) || defined(MULTIPLICITY)
                sv_catpv(PL_Sv,"\"  Compile-time options:");
 #  ifdef DEBUGGING
                sv_catpv(PL_Sv," DEBUGGING");
@@ -819,8 +818,20 @@ S_parse_body(pTHX_ va_list args)
 #  ifdef MULTIPLICITY
                sv_catpv(PL_Sv," MULTIPLICITY");
 #  endif
+#  ifdef USE_THREADS
+               sv_catpv(PL_Sv," USE_THREADS");
+#  endif
+#  ifdef PERL_OBJECT
+               sv_catpv(PL_Sv," PERL_OBJECT");
+#  endif
+#  ifdef PERL_IMPLICIT_CONTEXT
+               sv_catpv(PL_Sv," PERL_IMPLICIT_CONTEXT");
+#  endif
+#  ifdef PERL_IMPLICIT_SYS
+               sv_catpv(PL_Sv," PERL_IMPLICIT_SYS");
+#  endif
                sv_catpv(PL_Sv,"\\n\",");
-#endif
+
 #if defined(LOCAL_PATCH_COUNT)
                if (LOCAL_PATCH_COUNT > 0) {
                    int i;
index 664164d..ecb450e 100644 (file)
@@ -30,3 +30,7 @@ PERLVARIC(Gpatleave,  char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
 
 /* XXX does anyone even use this? */
 PERLVARI(Gdo_undump,   bool,   FALSE)  /* -u or dump seen? */
+
+#ifdef MYMALLOC
+PERLVAR(Gmalloc_mutex, perl_mutex)     /* Mutex for malloc */
+#endif