* dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging which

allocates a lot of space at startup.
This commit is contained in:
Christopher Faylor 2011-02-18 17:43:22 +00:00
parent f65dbc7e27
commit 734e1c50ff
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-02-18 Christopher Faylor <me+cygwin@cgf.cx>
* dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging
which allocates a lot of space at startup.
2011-02-18 Corinna Vinschen <corinna@vinschen.de> 2011-02-18 Corinna Vinschen <corinna@vinschen.de>
* cygwin.sc: Set alignment of .cygheap section to 64K. * cygwin.sc: Set alignment of .cygheap section to 64K.

View File

@ -802,11 +802,20 @@ dll_crt0_1 (void *)
malloc_init (); malloc_init ();
user_shared->initialize (); user_shared->initialize ();
#ifdef CGF #ifdef CYGHEAP_DEBUG
int i = 0; int i = 0;
const int n = 2 * 1024 * 1024; const int n = 2 * 1024 * 1024;
while (i--) while (i--)
small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n)); {
void *p = cmalloc (HEAP_STR, n);
if (p)
small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
else
{
small_printf ("total allocated %p\n", (i - 1) * n);
break;
}
}
#endif #endif
ProtectHandle (hMainThread); ProtectHandle (hMainThread);