Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-02-18 20:43:22 +0300
committerChristopher Faylor <me@cgf.cx>2011-02-18 20:43:22 +0300
commit734e1c50ff010a2c7aaab6bdcdb3e7756574f7da (patch)
treec4d46d645a04c8406fdd5c7da51624b4fe499ae1
parentf65dbc7e27a5b3e14249fc6b16cf0f8328262aea (diff)
* dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging which
allocates a lot of space at startup.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dcrt0.cc13
2 files changed, 16 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 6b1a79d1d..80e8e401f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* cygwin.sc: Set alignment of .cygheap section to 64K.
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);