diff options
| author | Paul Eggert | 2013-07-01 14:06:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-01 14:06:12 -0700 |
| commit | 8f43ce497c3fcd76d0d3be2d8a0506c53c757fb3 (patch) | |
| tree | 196afeabe60fd7b5e2b1ec27e8d8f793c32edc11 /src/emacs.c | |
| parent | 24827db9c4dd4597715958a3f6178cd2173251e1 (diff) | |
| download | emacs-8f43ce497c3fcd76d0d3be2d8a0506c53c757fb3.tar.gz emacs-8f43ce497c3fcd76d0d3be2d8a0506c53c757fb3.zip | |
Fix bug re noninteractive multithreaded memory allocation.
* emacs.c (malloc_enable_thread): Hoist extern decl to top level.
(main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
Invoke malloc_enable_thread even when not interactive.
Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
* process.c (init_process_emacs) [CYGWIN]: Tickle glib even
in this case, since the underlying bug has now been fixed.
Diffstat (limited to 'src/emacs.c')
| -rw-r--r-- | src/emacs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/emacs.c b/src/emacs.c index 77ae977b37c..08be786de95 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -127,6 +127,8 @@ extern int malloc_set_state (void*); | |||
| 127 | /* True if the MALLOC_CHECK_ environment variable was set while | 127 | /* True if the MALLOC_CHECK_ environment variable was set while |
| 128 | dumping. Used to work around a bug in glibc's malloc. */ | 128 | dumping. Used to work around a bug in glibc's malloc. */ |
| 129 | static bool malloc_using_checking; | 129 | static bool malloc_using_checking; |
| 130 | #elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC | ||
| 131 | extern void malloc_enable_thread (void); | ||
| 130 | #endif | 132 | #endif |
| 131 | 133 | ||
| 132 | Lisp_Object Qfile_name_handler_alist; | 134 | Lisp_Object Qfile_name_handler_alist; |
| @@ -1074,13 +1076,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1074 | #endif /* DOS_NT */ | 1076 | #endif /* DOS_NT */ |
| 1075 | } | 1077 | } |
| 1076 | 1078 | ||
| 1077 | #if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC) | 1079 | #if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC |
| 1078 | if (! noninteractive) | 1080 | malloc_enable_thread (); |
| 1079 | { | ||
| 1080 | extern void malloc_enable_thread (void); | ||
| 1081 | |||
| 1082 | malloc_enable_thread (); | ||
| 1083 | } | ||
| 1084 | #endif | 1081 | #endif |
| 1085 | 1082 | ||
| 1086 | init_signals (dumping); | 1083 | init_signals (dumping); |