www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/11/05:00:24

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: One more fix :-)
11 Feb 1998 05:00:24 -0800 :
Message-ID: <01BD3700.3780FD90.cygnus.cygwin32.developers@gater.krystalbank.msk.ru>
Reply-To: cygwin32-developers AT cygnus DOT com
To: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019