summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);