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.
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 -
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.
+
* 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
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 */
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;
/* 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) {