/* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.46 2001/08/08 14:14:08 simonmar Exp $
+ * $Id: Storage.c,v 1.52 2001/10/18 14:41:01 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* ---------------------------------------------------------------------------*/
+#include "PosixSource.h"
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
#include "MBlock.h"
#include "Weak.h"
#include "Sanity.h"
+#include "Arena.h"
#include "Storage.h"
#include "Schedule.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;
}
}
/* 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];
total_blocks += bd->blocks;
}
+ // count the blocks allocated by the arena allocator
+ total_blocks += arenaBlocks();
+
/* count the blocks on the free list */
free_blocks = countFreeList();