Commit 44ccabe6 authored by Simon Marlow's avatar Simon Marlow
Browse files

Round stack size to a whole number of megablocks

This is not a bug fix, it just makes better use of memory
parent 32ca5da8
...@@ -84,7 +84,7 @@ createThread(Capability *cap, nat size) ...@@ -84,7 +84,7 @@ createThread(Capability *cap, nat size)
size = MIN_STACK_WORDS + TSO_STRUCT_SIZEW; 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); tso = (StgTSO *)allocateLocal(cap, size);
TICK_ALLOC_TSO(stack_size, 0); TICK_ALLOC_TSO(stack_size, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment