/* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.45 2001/08/08 11:27:17 simonmar Exp $
+ * $Id: Storage.c,v 1.51 2001/10/01 11:09:02 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* ---------------------------------------------------------------------------*/
+#include "PosixSource.h"
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;
}
+ if (RtsFlags.GcFlags.maxHeapSize != 0 &&
+ RtsFlags.GcFlags.minAllocAreaSize >
+ RtsFlags.GcFlags.maxHeapSize) {
+ prog_belch("maximum heap size (-M) is smaller than minimum alloc area size (-A)");
+ exit(1);
+ }
+
initBlockAllocator();
/* allocate generation info array */
stp->scan = NULL;
stp->scan_bd = NULL;
stp->large_objects = NULL;
+ stp->n_large_blocks = 0;
stp->new_large_objects = NULL;
stp->scavenged_large_objects = NULL;
+ stp->n_scavenged_large_blocks = 0;
stp->is_compacted = 0;
+ stp->bitmap = NULL;
}
}
generations[g].steps[s].to = &generations[g+1].steps[0];
}
- /* The oldest generation has one step. */
+ /* The oldest generation has one step and it is compacted. */
+ if (RtsFlags.GcFlags.compact) {
+ 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];
/* generation 0 is special: that's the nursery */