Round stack size to a whole number of megablocks
[ghc-hetmet.git] / rts / Threads.c
index 501c751..d578cc2 100644 (file)
@@ -84,7 +84,7 @@ createThread(Capability *cap, nat size)
        size = MIN_STACK_WORDS + TSO_STRUCT_SIZEW;
     }
 
-    stack_size = size - TSO_STRUCT_SIZEW;
+    stack_size = round_to_mblocks(size) - TSO_STRUCT_SIZEW;
     
     tso = (StgTSO *)allocateLocal(cap, size);
     TICK_ALLOC_TSO(stack_size, 0);