aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorMiles Bader2007-08-03 05:20:51 +0000
committerMiles Bader2007-08-03 05:20:51 +0000
commite145a7fe95fb8f97407d125f94653ef95e42696d (patch)
tree4f83705aac9d1a4416dabcf774115f7cccb80bda /src/gmalloc.c
parent2a4924ce174b1a2b032558f3036f1d95445c4936 (diff)
parent2f12b713116a4e15b4744fc78d5f0dbb57fcd1ca (diff)
downloademacs-e145a7fe95fb8f97407d125f94653ef95e42696d.tar.gz
emacs-e145a7fe95fb8f97407d125f94653ef95e42696d.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 832-838) - Remove lisp/erc/erc-nicklist.el - Update some .arch-inventory files - Fix void function definition error in cus-edit.el - Update from CVS - Restore lisp/emacs-lisp/cl-loaddefs.el - Merge from emacs--rel--22 * emacs--rel--22 (patch 75-83) - Update from CVS - Remove lisp/erc/erc-nicklist.el - Update some .arch-inventory files - Indicate that emacs--devo--0--patch-834 does not need to be applied - Merge from gnus--rel--5.10 - Restore lisp/emacs-lisp/cl-loaddefs.el * gnus--rel--5.10 (patch 239-241) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-239
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index fcd9f655321..cf79b9159f2 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -561,7 +561,6 @@ register_heapinfo ()
561} 561}
562 562
563#ifdef USE_PTHREAD 563#ifdef USE_PTHREAD
564static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT;
565pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; 564pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
566pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; 565pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
567#endif 566#endif
@@ -607,18 +606,16 @@ malloc_initialize_1 ()
607 return; 606 return;
608} 607}
609 608
610/* Set everything up and remember that we have. */ 609/* Set everything up and remember that we have.
610 main will call malloc which calls this function. That is before any threads
611 or signal handlers has been set up, so we don't need thread protection. */
611int 612int
612__malloc_initialize () 613__malloc_initialize ()
613{ 614{
614#ifdef USE_PTHREAD
615 pthread_once (&malloc_init_once_control, malloc_initialize_1);
616#else
617 if (__malloc_initialized) 615 if (__malloc_initialized)
618 return 0; 616 return 0;
619 617
620 malloc_initialize_1 (); 618 malloc_initialize_1 ();
621#endif
622 619
623 return __malloc_initialized; 620 return __malloc_initialized;
624} 621}