diff options
author | Christopher Faylor <me@cgf.cx> | 2011-02-18 20:43:22 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-02-18 20:43:22 +0300 |
commit | 734e1c50ff010a2c7aaab6bdcdb3e7756574f7da (patch) | |
tree | c4d46d645a04c8406fdd5c7da51624b4fe499ae1 /winsup/cygwin/dcrt0.cc | |
parent | f65dbc7e27a5b3e14249fc6b16cf0f8328262aea (diff) |
* dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging which
allocates a lot of space at startup.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 4c2a66936..af0cf4e14 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -802,11 +802,20 @@ dll_crt0_1 (void *) malloc_init (); user_shared->initialize (); -#ifdef CGF +#ifdef CYGHEAP_DEBUG int i = 0; const int n = 2 * 1024 * 1024; 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 ProtectHandle (hMainThread); |