projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
48685b2
)
pruneSparkQueue(): fix bug when top>bottom
author
Simon Marlow
<marlowsd@gmail.com>
Thu, 6 Nov 2008 15:56:48 +0000
(15:56 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Thu, 6 Nov 2008 15:56:48 +0000
(15:56 +0000)
rts/Sparks.c
patch
|
blob
|
history
diff --git
a/rts/Sparks.c
b/rts/Sparks.c
index
e7273f3
..
cb3d8d9
100644
(file)
--- a/
rts/Sparks.c
+++ b/
rts/Sparks.c
@@
-389,6
+389,12
@@
pruneSparkQueue (evac_fn evac, void *user, Capability *cap)
pool = cap->sparks;
pool = cap->sparks;
+ // it is possible that top > bottom, indicating an empty pool. We
+ // fix that here; this is only necessary because the loop below
+ // assumes it.
+ if (pool->top > pool->bottom)
+ pool->top = pool->bottom;
+
// Take this opportunity to reset top/bottom modulo the size of
// the array, to avoid overflow. This is only possible because no
// stealing is happening during GC.
// Take this opportunity to reset top/bottom modulo the size of
// the array, to avoid overflow. This is only possible because no
// stealing is happening during GC.