OSDN Git Service

* dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that cxx_malloc
authorcgf <cgf>
Mon, 21 Sep 2009 02:32:05 +0000 (02:32 +0000)
committercgf <cgf>
Mon, 21 Sep 2009 02:32:05 +0000 (02:32 +0000)
is always set to the cygwin version.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc

index e8e67d9..3a4a818 100644 (file)
@@ -1,5 +1,10 @@
 2009-09-20  Christopher Faylor  <me+cygwin@cgf.cx>
 
+       * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that
+       cxx_malloc is always set to the cygwin version.
+
+2009-09-20  Christopher Faylor  <me+cygwin@cgf.cx>
+
        * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to
        proper value.
 
index e491837..2a02345 100644 (file)
@@ -766,6 +766,12 @@ dll_crt0_1 (void *)
     sigproc_init ();
   check_sanity_and_sync (user_data);
 
+  /* This is a kludge to work around a version of _cygwin_common_crt0
+     which overwrote the cxx_malloc field with the local DLL copy.
+     Hilarity ensues if the DLL is not loaded like while the process
+     is forking. */
+  __cygwin_user_data.cxx_malloc = &default_cygwin_cxx_malloc;
+
   /* Initialize malloc and then call user_shared_initialize since it relies
      on a functioning malloc and it's possible that the user's program may
      have overridden malloc.  We only know about that at this stage,