Only allocate a mark stack if we're actually doing marking
authorSimon Marlow <marlowsd@gmail.com>
Wed, 12 Nov 2008 11:21:44 +0000 (11:21 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 12 Nov 2008 11:21:44 +0000 (11:21 +0000)
saves a bit of memory in major GCs

rts/sm/GC.c

index 5cd1298..aff3320 100644 (file)
@@ -289,7 +289,7 @@ GarbageCollect ( rtsBool force_major_gc )
 
   /* Allocate a mark stack if we're doing a major collection.
    */
-  if (major_gc) {
+  if (major_gc && oldest_gen->steps[0].mark) {
       nat mark_stack_blocks;
       mark_stack_blocks = stg_max(MARK_STACK_BLOCKS, 
                                   oldest_gen->steps[0].n_old_blocks / 100);