Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
32ca5da8
Commit
32ca5da8
authored
May 28, 2009
by
Simon Marlow
Browse files
Fix #3156: ensure preconditions of splitLargeBlock()
parent
c34d7dd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/Schedule.c
View file @
32ca5da8
...
...
@@ -2436,9 +2436,16 @@ threadStackUnderflow (Task *task STG_UNUSED, StgTSO *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
)
// or stack is using more than 1/4 of the available space
{
// then do nothing
return
tso
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment