summaryrefslogtreecommitdiff
path: root/rts/ThreadPaused.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-01-28 12:44:54 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-01-28 12:44:54 +0000
commit990171bf9ee314fff0a72f8f875f0a62f6e494b7 (patch)
treea5c694811b40c428cf6017c12511472cd92fa625 /rts/ThreadPaused.c
parenta8a47739b957a51da50677cb9bce4364963ada39 (diff)
downloadhaskell-990171bf9ee314fff0a72f8f875f0a62f6e494b7.tar.gz
tweak the totally-bogus arbitrary stack-squeezing heuristic to fix #2797
In #2797, a program that ran in constant stack space when compiled needed linear stack space when interpreted. It turned out to be nothing more than stack-squeezing not happening. We have a heuristic to avoid stack-squeezing when it would be too expensive (shuffling a large amount of memory to save a few words), but in some cases even expensive stack-squeezing is necessary to avoid linear stack usage. One day we should implement stack chunks, which would make this less expensive.
Diffstat (limited to 'rts/ThreadPaused.c')
-rw-r--r--rts/ThreadPaused.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c
index 93ec960367..75712b04d6 100644
--- a/rts/ThreadPaused.c
+++ b/rts/ThreadPaused.c
@@ -315,7 +315,8 @@ end:
// the number of words we have to shift down is less than the
// number of stack words we squeeze away by doing so.
if (RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue &&
- ((weight <= 5 && words_to_squeeze > 0) || weight < words_to_squeeze)) {
+ ((weight <= 8 && words_to_squeeze > 0) || weight < words_to_squeeze)) {
+ // threshold above bumped from 5 to 8 as a result of #2797
stackSqueeze(cap, tso, (StgPtr)frame);
tso->flags |= TSO_SQUEEZED;
// This flag tells threadStackOverflow() that the stack was