From 73f5c435274b23a94e93f1282a12b7f775667eb8 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Tue, 15 Mar 1994 00:00:00 +0000 Subject: [PATCH] gc3.7 tarball import --- README | 10 ++++++++-- misc.c | 18 +++++++++++------- new_hblk.c | 4 ++-- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README b/README index 566078d7..60381f50 100644 --- 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 77c29399..139605ba 100644 --- 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; diff --git a/new_hblk.c b/new_hblk.c index 2007294e..78b5bf52 100644 --- a/new_hblk.c +++ b/new_hblk.c @@ -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) { -- 2.40.0