]> granicus.if.org Git - gc/commitdiff
2009-11-03 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Tue, 3 Nov 2009 22:06:30 +0000 (22:06 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:51 +0000 (21:06 +0400)
        * alloc.c: Revert last change.

ChangeLog
alloc.c

index bd6b8a03c5480861b92a4948a80ac0898498d0e8..f03c6138d6af9800c16d6d9b5ec2e3802b3e019f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-03  Hans Boehm <Hans.Boehm@hp.com>
+
+       * alloc.c: Revert last change.
+
 2009-11-02  Ivan Maidanski <ivmai@mail.ru>
 
        * include/private/gcconfig.h (STACKBOTTOM): Add a presence check
diff --git a/alloc.c b/alloc.c
index 56d565a90fc48591c48746d74ed7af981234254e..3efbde7fa1f74fa0739b38b5790edea8f01cd0d5 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -190,9 +190,13 @@ GC_API GC_stop_func GC_CALL GC_get_stop_func(void)
 /* collections to amortize the collection cost.                         */
 static word min_bytes_allocd(void)
 {
-    int dummy;
-    signed_word stack_size = (ptr_t)(&dummy) - GC_stackbottom;
-
+#   ifdef THREADS
+        /* We punt, for now. */
+        signed_word stack_size = 10000;
+#   else
+        int dummy;
+        signed_word stack_size = (ptr_t)(&dummy) - GC_stackbottom;
+#   endif
     word total_root_size;           /* includes double stack size,      */
                                     /* since the stack is expensive     */
                                     /* to scan.                         */
@@ -200,14 +204,6 @@ static word min_bytes_allocd(void)
                                 /* during normal GC.                    */
 
     if (stack_size < 0) stack_size = -stack_size;
-
-#   ifdef THREADS
-      if (GC_need_to_lock) {
-        /* We are multi-threaded. */
-        if (stack_size < 10000) stack_size = 10000; /* We punt, for now. */
-      }
-#   endif
-
     total_root_size = 2 * stack_size + GC_root_size;
     scan_size = 2 * GC_composite_in_use + GC_atomic_in_use/4
                 + total_root_size;