comparison src/emacs.c @ 24418:882205f5e5b9

(main) [DOUG_LEA_MALLOC]: Don't use unsetenv, it calls malloc in glibc 2.1.
author Andreas Schwab <schwab@suse.de>
date Sun, 28 Feb 1999 02:12:07 +0000
parents 61704c572291
children 930074eb767f
comparison
equal deleted inserted replaced
24417:8a8615132482 24418:882205f5e5b9
569 if (initialized) 569 if (initialized)
570 { 570 {
571 if (!malloc_using_checking) 571 if (!malloc_using_checking)
572 /* Work around a bug in glibc's malloc. MALLOC_CHECK_ must be 572 /* Work around a bug in glibc's malloc. MALLOC_CHECK_ must be
573 ignored if the heap to be restored was constructed without 573 ignored if the heap to be restored was constructed without
574 malloc checking. */ 574 malloc checking. Can't use unsetenv, since that calls malloc. */
575 unsetenv ("MALLOC_CHECK_"); 575 {
576 char **p;
577
578 for (p = envp; *p; p++)
579 if (strncmp (*p, "MALLOC_CHECK_=", 14) == 0)
580 {
581 do
582 *p = p[1];
583 while (*++p);
584 break;
585 }
586 }
576 malloc_set_state (malloc_state_ptr); 587 malloc_set_state (malloc_state_ptr);
577 free (malloc_state_ptr); 588 free (malloc_state_ptr);
578 } 589 }
579 else 590 else
580 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; 591 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;