comparison src/gmalloc.c @ 90998:539530fa389c

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
author Miles Bader <miles@gnu.org>
date Fri, 03 Aug 2007 05:20:51 +0000
parents 988f1edc9674 8cc259bc54fd
children 424b655804ca
comparison
equal deleted inserted replaced
90997:12fc8f96710b 90998:539530fa389c
559 while (--blocks > 0) 559 while (--blocks > 0)
560 _heapinfo[block + blocks].busy.info.size = -blocks; 560 _heapinfo[block + blocks].busy.info.size = -blocks;
561 } 561 }
562 562
563 #ifdef USE_PTHREAD 563 #ifdef USE_PTHREAD
564 static pthread_once_t malloc_init_once_control = PTHREAD_ONCE_INIT;
565 pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER; 564 pthread_mutex_t _malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
566 pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER; 565 pthread_mutex_t _aligned_blocks_mutex = PTHREAD_MUTEX_INITIALIZER;
567 #endif 566 #endif
568 567
569 static void 568 static void
605 __malloc_initialized = 1; 604 __malloc_initialized = 1;
606 PROTECT_MALLOC_STATE (1); 605 PROTECT_MALLOC_STATE (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. */
611 int 612 int
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 }
625 622
626 static int morecore_recursing; 623 static int morecore_recursing;