]> granicus.if.org Git - gc/commitdiff
gc3.7 tarball import gc3_7
authorHans Boehm <boehm@acm.org>
Tue, 15 Mar 1994 00:00:00 +0000 (00:00 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 17 May 2014 12:19:43 +0000 (16:19 +0400)
README
misc.c
new_hblk.c

diff --git a/README b/README
index 566078d783670b649b36321ca8ed261e08655208..60381f505b893f9a7cea7cb5a37be0ea23cfadf2 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
-Copyright (c) 1991-1993 by Xerox Corporation.  All rights reserved.
+Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
 
 THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
 OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
@@ -8,7 +8,7 @@ Permission is hereby granted to copy this garbage collector for any purpose,
 provided the above notices are retained on all copies.
 
 
-This is version 3.6.  Note that functions were renamed since version 1.9
+This is version 3.7.  Note that functions were renamed since version 1.9
 to make naming consistent with PCR collectors.
 
 HISTORY -
@@ -713,3 +713,9 @@ Version 3.6:
   in 3.4.
 - fixed Makefile to work around DEC AXP compiler tail recursion
   bug.
+
+Version 3.7:
+- Added a workaround for an HP/UX compiler bug.
+- Fixed another stack clearing performance bug.  Reworked
+  that code once more.
+
diff --git a/misc.c b/misc.c
index 77c293992b4736fc941d807f300b9008e8cb1dff..139605bad657ba8ac30c5c8de45f3922f6515524 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -8,7 +8,7 @@
  * Permission is hereby granted to copy this garbage collector for any purpose,
  * provided the above notices are retained on all copies.
  */
-/* Boehm, December 20, 1993 3:06 pm PST */
+/* Boehm, March 14, 1994 3:21 pm PST */
 
 #define DEBUG       /* Some run-time consistency checks */
 #undef DEBUG
@@ -226,10 +226,13 @@ ptr_t arg;
         word dummy[CLEAR_SIZE];;
 #   endif
     
-#   define SLOP 200
+#   define SLOP 400
        /* Extra bytes we clear every time.  This clears our own        */
        /* activation record, and should cause more frequent            */
        /* clearing near the cold end of the stack, a good thing.       */
+#   define GC_SLOP 4000
+       /* We make GC_high_water this much hotter than we really saw    */
+       /* saw it, to cover for GC noise etc. above our current frame.  */
 #   define CLEAR_THRESHOLD 100000
        /* We restart the clearing process after this many bytes of     */
        /* allocation.  Otherwise very heavily recursive programs       */
@@ -249,18 +252,19 @@ ptr_t arg;
         GC_words_allocd_at_reset = GC_words_allocd;
     }
     /* Adjust GC_high_water */
-        MAKE_COOLER(GC_high_water, WORDS_TO_BYTES(DEGRADE_RATE));
+        MAKE_COOLER(GC_high_water, WORDS_TO_BYTES(DEGRADE_RATE) + GC_SLOP);
         if (sp HOTTER_THAN GC_high_water) {
             GC_high_water = sp;
         }
-    if (sp COOLER_THAN GC_min_sp) {
-        limit = GC_min_sp;
-        MAKE_HOTTER(limit, SLOP);
+        MAKE_HOTTER(GC_high_water, GC_SLOP);
+    limit = GC_min_sp;
+    MAKE_HOTTER(limit, SLOP);
+    if (sp COOLER_THAN limit) {
         limit &= ~0xf; /* Make it sufficiently aligned for assembly    */
                        /* implementations of GC_clear_stack_inner.     */
         GC_min_sp = sp;
         return(GC_clear_stack_inner(arg, limit));
-    } else if (WORDS_TO_BYTES(GC_words_allocd_at_reset - GC_words_allocd)
+    } else if (WORDS_TO_BYTES(GC_words_allocd - GC_words_allocd_at_reset)
               > CLEAR_THRESHOLD) {
        /* Restart clearing process, but limit how much clearing we do. */
        GC_min_sp = sp;
index 2007294e481f957a2baf154ff5aac756e1a33b8a..78b5bf52c765ec27d40febe1457ec2c245ca1147 100644 (file)
@@ -209,8 +209,8 @@ int kind;
   /* Add objects to free list */
     p = &(h -> hb_body[sz]);   /* second object in *h  */
     prev = &(h -> hb_body[0]);         /* One object behind p  */
-    last_object = ((word *)((char *)h + HBLKSIZE)) - sz;
-                           /* Last place for last object to start */
+    last_object = (word *)((char *)h + HBLKSIZE);
+    last_object -= sz;  /* Last place for last object to start */
 
   /* make a list of all objects in *h with head as last object */
     while (p <= last_object) {