[project @ 2001-08-30 10:21:40 by simonmar]
authorsimonmar <unknown>
Thu, 30 Aug 2001 10:21:40 +0000 (10:21 +0000)
committersimonmar <unknown>
Thu, 30 Aug 2001 10:21:40 +0000 (10:21 +0000)
Automatically disable compaction when there's only one generation
(-G1) and print a warning to that effect.

ghc/rts/Storage.c

index a2c111b..8cba094 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.49 2001/08/14 13:40:09 sewardj Exp $
+ * $Id: Storage.c,v 1.50 2001/08/30 10:21:40 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -168,7 +168,11 @@ initStorage( void )
   
   /* The oldest generation has one step and it is compacted. */
   if (RtsFlags.GcFlags.compact) {
-      oldest_gen->steps[0].is_compacted = 1;
+      if (RtsFlags.GcFlags.generations == 1) {
+         belch("WARNING: compaction is incompatible with -G1; disabled");
+      } else {
+         oldest_gen->steps[0].is_compacted = 1;
+      }
   }
   oldest_gen->steps[0].to = &oldest_gen->steps[0];