Patch to dcrt0.cc for dmalloc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch to dcrt0.cc for dmalloc

Pierre A Humblet


2006-04-06  Pierre Humblet  <[hidden email]>

        * drct0.cc (dll_crt0_1): Move malloc_init after
user_data->resourcelocks->Init.



diff -u -p -r1.303 dcrt0.cc
--- dcrt0.cc    3 Apr 2006 17:33:07 -0000       1.303
+++ dcrt0.cc    5 Apr 2006 16:07:53 -0000
@@ -784,7 +784,6 @@ static void
 dll_crt0_1 (char *)
 {
   check_sanity_and_sync (user_data);
-  malloc_init ();
 #ifdef CGF
   int i = 0;
   const int n = 2 * 1024 * 1024;
@@ -794,6 +793,7 @@ dll_crt0_1 (char *)
 
   user_data->resourcelocks->Init ();
   user_data->threadinterface->Init ();
+  malloc_init ();
   ProtectHandle (hMainProc);
   ProtectHandle (hMainThread);

Reply | Threaded
Open this post in threaded view
|

Re: Patch to dcrt0.cc for dmalloc

Christopher Faylor-2
On Wed, Apr 05, 2006 at 08:16:22PM -0400, Pierre A. Humblet wrote:
>2006-04-06  Pierre Humblet  <[hidden email]>
>
> * drct0.cc (dll_crt0_1): Move malloc_init after
>user_data->resourcelocks->Init.

As I mentioned in cygwin-developers "those two lines" (i.e., the ->Init
lines that are required for proper operation of user_data->resourcelocks
that you were mentioning) could and have been moved back into dll_crt0_0
so there is no reason for this patch that I can see.

cgf

>diff -u -p -r1.303 dcrt0.cc
>--- dcrt0.cc    3 Apr 2006 17:33:07 -0000       1.303
>+++ dcrt0.cc    5 Apr 2006 16:07:53 -0000
>@@ -784,7 +784,6 @@ static void
> dll_crt0_1 (char *)
> {
>   check_sanity_and_sync (user_data);
>-  malloc_init ();
> #ifdef CGF
>   int i = 0;
>   const int n = 2 * 1024 * 1024;
>@@ -794,6 +793,7 @@ dll_crt0_1 (char *)
>
>   user_data->resourcelocks->Init ();
>   user_data->threadinterface->Init ();
>+  malloc_init ();
>   ProtectHandle (hMainProc);
>   ProtectHandle (hMainThread);
>