projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c34d7dd
)
Fix #3156: ensure preconditions of splitLargeBlock()
author
Simon Marlow
<marlowsd@gmail.com>
Thu, 28 May 2009 13:33:57 +0000
(13:33 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Thu, 28 May 2009 13:33:57 +0000
(13:33 +0000)
rts/Schedule.c
patch
|
blob
|
history
diff --git
a/rts/Schedule.c
b/rts/Schedule.c
index
0b4c5b6
..
f376286
100644
(file)
--- a/
rts/Schedule.c
+++ b/
rts/Schedule.c
@@
-2436,9
+2436,16
@@
threadStackUnderflow (Task *task STG_UNUSED, StgTSO *tso)
tso_size_w = tso_sizeW(tso);
tso_size_w = tso_sizeW(tso);
- if (tso_size_w < MBLOCK_SIZE_W ||
+ if (tso_size_w < MBLOCK_SIZE_W ||
+ // TSO is less than 2 mblocks (since the first mblock is
+ // shorter than MBLOCK_SIZE_W)
+ (tso_size_w - BLOCKS_PER_MBLOCK*BLOCK_SIZE_W) % MBLOCK_SIZE_W != 0 ||
+ // or TSO is not a whole number of megablocks (ensuring
+ // precondition of splitLargeBlock() below)
(nat)(tso->stack + tso->stack_size - tso->sp) > tso->stack_size / 4)
(nat)(tso->stack + tso->stack_size - tso->sp) > tso->stack_size / 4)
+ // or stack is using more than 1/4 of the available space
{
{
+ // then do nothing
return tso;
}
return tso;
}