Mail Archives: cygwin-developers/1998/02/11/05:00:24
Hi!
malloc.cc (malloc_init): do not check for application's malloc in a forkee, this
breaks memory coherency in a forkee and forker. use_internal_malloc flag
now copies on fork.
H:\usr\src\cygnus\cdk\winsup>diff -up malloc.cc.orig malloc.cc
--- malloc.cc.orig Wed Feb 11 02:36:20 1998
+++ malloc.cc Wed Feb 11 15:00:36 1998
@@ -120,9 +120,12 @@ malloc_init ()
calls to export_malloc/free/realloc to application provided. This may
happen if some other dll calls cygwin's malloc, but main code provides
its own malloc */
- free (malloc (16));
- if (!export_malloc_called)
- use_internal_malloc = 0;
+ if (!u->forkee)
+ {
+ free (malloc (16));
+ if (!export_malloc_called)
+ use_internal_malloc = 0;
+ }
}
extern "C"
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.
- Raw text -