From: Gurusamy Sarathy Date: Sun, 17 Oct 1999 23:43:59 +0000 (+0000) Subject: PL_malloc_mutex needs to be global, not per-interpreter X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b363f7ed458679f785ff5f459a6ae701688eb6f5;p=p5sagit%2Fp5-mst-13.2.git PL_malloc_mutex needs to be global, not per-interpreter (malloc.c has static data) p4raw-id: //depot/perl@4403 --- diff --git a/embedvar.h b/embedvar.h index 22a970a..b018119 100644 --- a/embedvar.h +++ b/embedvar.h @@ -304,7 +304,6 @@ #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) @@ -581,7 +580,6 @@ #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) @@ -860,7 +858,6 @@ #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 @@ -1285,6 +1282,7 @@ #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 */ @@ -1294,6 +1292,7 @@ #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 */ diff --git a/intrpvar.h b/intrpvar.h index 1a8b1bf..a60620f 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -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 *) diff --git a/objXSUB.h b/objXSUB.h index 9620006..fb8698b 100644 --- a/objXSUB.h +++ b/objXSUB.h @@ -274,8 +274,6 @@ #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 @@ -830,6 +828,8 @@ #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 --- 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; diff --git a/perlvars.h b/perlvars.h index 664164d..ecb450e 100644 --- a/perlvars.h +++ b/perlvars.h @@ -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