From eb567ae72a096016bef4ddcbd7821948ac356d18 Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Wed, 24 Feb 1999 16:30:45 +0000
Subject: [PATCH] [project @ 1999-02-24 16:30:45 by simonm] Don't promote
 blackholes from generation 0 if possible.

---
 ghc/rts/GC.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c
index 4ea369414122..45d1422ee42e 100644
--- a/ghc/rts/GC.c
+++ b/ghc/rts/GC.c
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.39 1999/02/24 16:25:40 simonm Exp $
+ * $Id: GC.c,v 1.40 1999/02/24 16:30:45 simonm Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -2247,7 +2247,15 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
 	    }
 	    continue;
 	  }
-	  step = bd->step->to;
+
+	  /* Don't promote blackholes */
+	  step = bd->step;
+	  if (!(step->gen->no == 0 && 
+		step->no != 0 &&
+		step->no == step->gen->n_steps-1)) {
+	    step = step->to;
+	  }
+
 	  switch (type) {
 	  case BLACKHOLE:
 	  case CAF_BLACKHOLE:
-- 
GitLab