From: Nick Ing-Simmons Date: Sat, 29 Nov 1997 17:29:07 +0000 (+0000) Subject: Sort out malloc_mutex for perl's malloc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dc86dda37b501f4e7680b77deeb8555508939782;p=p5sagit%2Fp5-mst-13.2.git Sort out malloc_mutex for perl's malloc Remove BINCOMPAT3 from embed.pl Add dependancy to CORE_H for PERL95_OBJ p4raw-id: //depot/ansiperl@333 --- diff --git a/dosish.h b/dosish.h index f18771b..f44eb72 100644 --- a/dosish.h +++ b/dosish.h @@ -20,7 +20,7 @@ void Perl_DJGPP_init(); # endif #endif /* DJGPP */ -#define PERL_SYS_TERM() +#define PERL_SYS_TERM() MALLOC_TERM #define dXSUB_SYS #define TMPPATH "plXXXXXX" diff --git a/embed.h b/embed.h index 541fcf7..caa1936 100644 --- a/embed.h +++ b/embed.h @@ -1,6 +1,6 @@ /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - This file is built by embed.pl from global.sym, interp.sym, - and compat3.sym. Any changes made here will be lost! + This file is built by embed.pl from global.sym and interp.sym. + Any changes made here will be lost! */ /* (Doing namespace management portably in C is really gross.) */ @@ -20,6 +20,7 @@ #ifdef EMBED #define AMG_names Perl_AMG_names +#define Error Perl_Error #define Gv_AMupdate Perl_Gv_AMupdate #define No Perl_No #define Sv Perl_Sv @@ -69,7 +70,9 @@ #define block_end Perl_block_end #define block_gimme Perl_block_gimme #define block_start Perl_block_start +#define block_type Perl_block_type #define bool__amg Perl_bool__amg +#define boot_core_UNIVERSAL Perl_boot_core_UNIVERSAL #define bor_amg Perl_bor_amg #define bufend Perl_bufend #define bufptr Perl_bufptr @@ -126,6 +129,7 @@ #define comppad Perl_comppad #define comppad_name Perl_comppad_name #define comppad_name_fill Perl_comppad_name_fill +#define comppad_name_floor Perl_comppad_name_floor #define concat_amg Perl_concat_amg #define concat_ass_amg Perl_concat_ass_amg #define condpair_magic Perl_condpair_magic @@ -151,6 +155,7 @@ #define debprofdump Perl_debprofdump #define debstack Perl_debstack #define debstackptrs Perl_debstackptrs +#define debug Perl_debug #define dec_amg Perl_dec_amg #define delimcpy Perl_delimcpy #define deprecate Perl_deprecate @@ -183,6 +188,7 @@ #define do_sysseek Perl_do_sysseek #define do_tell Perl_do_tell #define do_trans Perl_do_trans +#define do_undump Perl_do_undump #define do_vecset Perl_do_vecset #define do_vop Perl_do_vop #define dofindlabel Perl_dofindlabel @@ -366,6 +372,7 @@ #define magic_setvec Perl_magic_setvec #define magic_wipepack Perl_magic_wipepack #define magicname Perl_magicname +#define malloc_mutex Perl_malloc_mutex #define markstack Perl_markstack #define markstack_grow Perl_markstack_grow #define markstack_max Perl_markstack_max @@ -466,6 +473,8 @@ #define nexttoke Perl_nexttoke #define nexttype Perl_nexttype #define nextval Perl_nextval +#define nice_chunk Perl_nice_chunk +#define nice_chunk_size Perl_nice_chunk_size #define ninstr Perl_ninstr #define no_aelem Perl_no_aelem #define no_dir_func Perl_no_dir_func @@ -474,10 +483,13 @@ #define no_helem Perl_no_helem #define no_mem Perl_no_mem #define no_modify Perl_no_modify +#define no_myglob Perl_no_myglob #define no_op Perl_no_op #define no_security Perl_no_security #define no_sock_func Perl_no_sock_func +#define no_symref Perl_no_symref #define no_usym Perl_no_usym +#define no_wrongref Perl_no_wrongref #define nointrp Perl_nointrp #define nomem Perl_nomem #define nomemok Perl_nomemok @@ -511,9 +523,11 @@ #define pad_free Perl_pad_free #define pad_leavemy Perl_pad_leavemy #define pad_reset Perl_pad_reset +#define pad_reset_pending Perl_pad_reset_pending #define pad_sv Perl_pad_sv #define pad_swipe Perl_pad_swipe #define padix Perl_padix +#define padix_floor Perl_padix_floor #define patleave Perl_patleave #define peep Perl_peep #define pidgone Perl_pidgone @@ -915,6 +929,14 @@ #define rxres_free Perl_rxres_free #define rxres_restore Perl_rxres_restore #define rxres_save Perl_rxres_save +#define safecalloc Perl_safecalloc +#define safefree Perl_safefree +#define safemalloc Perl_safemalloc +#define saferealloc Perl_saferealloc +#define safexcalloc Perl_safexcalloc +#define safexfree Perl_safexfree +#define safexmalloc Perl_safexmalloc +#define safexrealloc Perl_safexrealloc #define same_dirent Perl_same_dirent #define save_I16 Perl_save_I16 #define save_I32 Perl_save_I32 @@ -931,6 +953,7 @@ #define save_hptr Perl_save_hptr #define save_int Perl_save_int #define save_item Perl_save_item +#define save_iv Perl_save_iv #define save_list Perl_save_list #define save_long Perl_save_long #define save_nogv Perl_save_nogv @@ -1049,6 +1072,7 @@ #define sv_no Perl_sv_no #define sv_nv Perl_sv_nv #define sv_peek Perl_sv_peek +#define sv_pvn Perl_sv_pvn #define sv_pvn_force Perl_sv_pvn_force #define sv_ref Perl_sv_ref #define sv_reftype Perl_sv_reftype @@ -1132,6 +1156,7 @@ #define warn_nl Perl_warn_nl #define warn_nosemi Perl_warn_nosemi #define warn_reserved Perl_warn_reserved +#define warn_uninit Perl_warn_uninit #define watch Perl_watch #define watchaddr Perl_watchaddr #define watchok Perl_watchok @@ -1145,6 +1170,7 @@ #define yycheck Perl_yycheck #define yydebug Perl_yydebug #define yydefred Perl_yydefred +#define yydestruct Perl_yydestruct #define yydgoto Perl_yydgoto #define yyerrflag Perl_yyerrflag #define yyerror Perl_yyerror @@ -1163,38 +1189,6 @@ #define yyval Perl_yyval #define yywarn Perl_yywarn -/* Hide global symbols that 5.003 revealed? */ - -#ifndef BINCOMPAT3 - -#define Error Perl_Error -#define block_type Perl_block_type -#define boot_core_UNIVERSAL Perl_boot_core_UNIVERSAL -#define comppad_name_floor Perl_comppad_name_floor -#define debug Perl_debug -#define do_undump Perl_do_undump -#define nice_chunk Perl_nice_chunk -#define nice_chunk_size Perl_nice_chunk_size -#define no_myglob Perl_no_myglob -#define no_symref Perl_no_symref -#define no_wrongref Perl_no_wrongref -#define pad_reset_pending Perl_pad_reset_pending -#define padix_floor Perl_padix_floor -#define safecalloc Perl_safecalloc -#define safefree Perl_safefree -#define safemalloc Perl_safemalloc -#define saferealloc Perl_saferealloc -#define safexcalloc Perl_safexcalloc -#define safexfree Perl_safexfree -#define safexmalloc Perl_safexmalloc -#define safexrealloc Perl_safexrealloc -#define save_iv Perl_save_iv -#define sv_pvn Perl_sv_pvn -#define warn_uninit Perl_warn_uninit -#define yydestruct Perl_yydestruct - -#endif /* !BINCOMPAT3 */ - #endif /* EMBED */ /* Put interpreter-specific symbols into a struct? */ @@ -1507,16 +1501,6 @@ #ifdef EMBED -#define curcop Perl_curcop -#define curcopdb Perl_curcopdb -#define envgv Perl_envgv -#define siggv Perl_siggv -#define tainting Perl_tainting - -/* Hide interpreter symbols that 5.003 revealed? */ - -#ifndef BINCOMPAT3 - #define Argv Perl_Argv #define Cmd Perl_Cmd #define DBgv Perl_DBgv @@ -1536,6 +1520,8 @@ #define chopset Perl_chopset #define copline Perl_copline #define curblock Perl_curblock +#define curcop Perl_curcop +#define curcopdb Perl_curcopdb #define curcsv Perl_curcsv #define curpm Perl_curpm #define curstack Perl_curstack @@ -1563,6 +1549,7 @@ #define e_fp Perl_e_fp #define e_tmpname Perl_e_tmpname #define endav Perl_endav +#define envgv Perl_envgv #define errgv Perl_errgv #define eval_root Perl_eval_root #define eval_start Perl_eval_start @@ -1633,6 +1620,7 @@ #define screamfirst Perl_screamfirst #define screamnext Perl_screamnext #define secondgv Perl_secondgv +#define siggv Perl_siggv #define signalstack Perl_signalstack #define sortcop Perl_sortcop #define sortstack Perl_sortstack @@ -1652,6 +1640,7 @@ #define sv_objcount Perl_sv_objcount #define sv_root Perl_sv_root #define tainted Perl_tainted +#define tainting Perl_tainting #define thrsv Perl_thrsv #define tmps_floor Perl_tmps_floor #define tmps_ix Perl_tmps_ix @@ -1662,8 +1651,5 @@ #define unsafe Perl_unsafe #define warnhook Perl_warnhook -#endif /* !BINCOMPAT3 */ - #endif /* EMBED */ - #endif /* MULTIPLICITY */ diff --git a/embed.pl b/embed.pl index 266a33e..68a15df 100755 --- a/embed.pl +++ b/embed.pl @@ -19,7 +19,6 @@ sub readsyms (\%$) { readsyms %global, 'global.sym'; readsyms %interp, 'interp.sym'; -readsyms %compat3, 'compat3.sym'; sub hide ($$) { my ($from, $to) = @_; @@ -45,8 +44,8 @@ open(EM, '> embed.h') print EM <<'END'; /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - This file is built by embed.pl from global.sym, interp.sym, - and compat3.sym. Any changes made here will be lost! + This file is built by embed.pl from global.sym and interp.sym. + Any changes made here will be lost! */ /* (Doing namespace management portably in C is really gross.) */ @@ -68,25 +67,12 @@ print EM <<'END'; END for $sym (sort keys %global) { - print EM embed($sym) unless $compat3{$sym}; + print EM embed($sym); } -print EM <<'END'; - -/* Hide global symbols that 5.003 revealed? */ - -#ifndef BINCOMPAT3 - -END - -for $sym (sort keys %global) { - print EM embed($sym) if $compat3{$sym}; -} print EM <<'END'; -#endif /* !BINCOMPAT3 */ - #endif /* EMBED */ /* Put interpreter-specific symbols into a struct? */ @@ -118,27 +104,12 @@ print EM <<'END'; END for $sym (sort keys %interp) { - print EM embed($sym) if $compat3{$sym}; -} - -print EM <<'END'; - -/* Hide interpreter symbols that 5.003 revealed? */ - -#ifndef BINCOMPAT3 - -END - -for $sym (sort keys %interp) { - print EM embed($sym) unless $compat3{$sym}; + print EM embed($sym); } print EM <<'END'; -#endif /* !BINCOMPAT3 */ - #endif /* EMBED */ - #endif /* MULTIPLICITY */ END diff --git a/global.sym b/global.sym index 4be609a..0298c96 100644 --- a/global.sym +++ b/global.sym @@ -544,6 +544,7 @@ magic_setvec magic_set_all_env magic_wipepack magicname +malloc_mutex markstack_grow mem_collxfrm mess diff --git a/perl.h b/perl.h index 2064bed..92f30be 100644 --- a/perl.h +++ b/perl.h @@ -1359,13 +1359,6 @@ typedef Sighandler_t Sigsave_t; # define MALLOC_TERM #endif -#ifdef MYMALLOC -# define MALLOC_INIT MUTEX_INIT(&malloc_mutex) -# define MALLOC_TERM MUTEX_DESTROY(&malloc_mutex) -#else -# define MALLOC_INIT -# define MALLOC_TERM -#endif /* * These need prototyping here because isn't diff --git a/win32/Makefile b/win32/Makefile index e2d3d44..2aab6cf 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -10,8 +10,8 @@ # Set these to wherever you want "nmake install" to put your # newly built perl. INST_DRV=c: -INST_TOP=$(INST_DRV)\perl -BUILDOPT=-DUSE_THREADS +INST_TOP=$(INST_DRV)\perl5004.5x +#BUILDOPT=-DUSE_THREADS CORECCOPT= # @@ -20,7 +20,7 @@ CORECCOPT= # # uncomment next line if you want debug version of perl (big,slow) -CFG=Debug +#CFG=Debug # # set the install locations of the compiler include/libraries @@ -333,9 +333,10 @@ $(MINIPERL) : ..\miniperlmain.obj $(CORE_OBJ) $(WIN32_OBJ) $(LINK_FLAGS) $(LIBFILES) ..\miniperlmain.obj $(CORE_OBJ) $(WIN32_OBJ) << -$(WIN32_OBJ) : $(CORE_H) -$(CORE_OBJ) : $(CORE_H) -$(DLL_OBJ) : $(CORE_H) +$(WIN32_OBJ) : $(CORE_H) +$(CORE_OBJ) : $(CORE_H) +$(DLL_OBJ) : $(CORE_H) +$(PERL95_OBJ) : $(CORE_H) perldll.def : $(MINIPERL) $(CONFIGPM) makedef.pl ..\global.sym $(MINIPERL) -w makedef.pl $(DEFINES) $(CCTYPE) > perldll.def diff --git a/win32/win32.c b/win32/win32.c index 613d981..ba60864 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1736,6 +1736,7 @@ Perl_win32_init(int *argcp, char ***argvp) #if !defined(_ALPHA_) && !defined(__GNUC__) _control87(MCW_EM, MCW_EM); #endif + MALLOC_INIT; } #ifdef USE_BINMODE_SCRIPTS