#include "Schedule.h"
#include "RetainerProfile.h" // for counting memory blocks (memInventory)
#include "OSMem.h"
+#include "Trace.h"
#include <stdlib.h>
#include <string.h>
RtsFlags.GcFlags.minAllocAreaSize >
RtsFlags.GcFlags.maxHeapSize) {
errorBelch("maximum heap size (-M) is smaller than minimum alloc area size (-A)");
- exit(1);
+ RtsFlags.GcFlags.minAllocAreaSize = RtsFlags.GcFlags.maxHeapSize;
}
initBlockAllocator();
void
freeStorage (void)
{
+ nat g;
+
+ for(g = 0; g < RtsFlags.GcFlags.generations; g++)
+ stgFree(generations[g].steps);
+ stgFree(generations);
freeAllMBlocks();
}
if (nursery_blocks == blocks) return;
if (nursery_blocks < blocks) {
- IF_DEBUG(gc, debugBelch("Increasing size of nursery to %d blocks\n",
- blocks));
+ debugTrace(DEBUG_gc, "increasing size of nursery to %d blocks",
+ blocks);
stp->blocks = allocNursery(stp, stp->blocks, blocks-nursery_blocks);
}
else {
bdescr *next_bd;
- IF_DEBUG(gc, debugBelch("Decreasing size of nursery to %d blocks\n",
- blocks));
+ debugTrace(DEBUG_gc, "decreasing size of nursery to %d blocks",
+ blocks);
bd = stp->blocks;
while (nursery_blocks > blocks) {
bdescr *bd;
lnat pagesize = getPageSize();
bd = allocGroup(stg_max(1, pagesize / BLOCK_SIZE));
- IF_DEBUG(gc, debugBelch("allocate exec block %p\n", bd->start));
+ debugTrace(DEBUG_gc, "allocate exec block %p", bd->start);
bd->gen_no = 0;
bd->flags = BF_EXEC;
bd->link = exec_block;
// Free the block if it is empty, but not if it is the block at
// the head of the queue.
if (bd->gen_no == 0 && bd != exec_block) {
- IF_DEBUG(gc, debugBelch("free exec block %p\n", bd->start));
+ debugTrace(DEBUG_gc, "free exec block %p", bd->start);
if (bd->u.back) {
bd->u.back->link = bd->link;
} else {