summaryrefslogtreecommitdiff
path: root/rts/Sparks.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-11-06 15:58:26 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-11-06 15:58:26 +0000
commita650cec6aebe5be3706f6aef603bd27a5c0ec1f0 (patch)
tree5e28cc083cb941dfe4897f970c96d04a3cacc950 /rts/Sparks.h
parent99836ac39665b577dde6945a60631c75e954e3dc (diff)
downloadhaskell-a650cec6aebe5be3706f6aef603bd27a5c0ec1f0.tar.gz
fix ASSERT_SPARK_POOL_INVARIANTS(): top>bottom is valid
Diffstat (limited to 'rts/Sparks.h')
-rw-r--r--rts/Sparks.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/rts/Sparks.h b/rts/Sparks.h
index 96968890ba..f24ccca4ff 100644
--- a/rts/Sparks.h
+++ b/rts/Sparks.h
@@ -51,17 +51,19 @@ typedef struct SparkPool_ {
} SparkPool;
-/* INVARIANTS, in this order: bottom/top consistent, reasonable size,
+/* INVARIANTS, in this order: reasonable size,
topBound consistent, space pointer, space accessible to us */
#define ASSERT_SPARK_POOL_INVARIANTS(p) \
- ASSERT((p)->bottom >= (p)->top); \
ASSERT((p)->size > 0); \
- ASSERT((p)->size > (p)->bottom - (p)->top); \
ASSERT((p)->topBound <= (p)->top); \
ASSERT((p)->elements != NULL); \
ASSERT(*((p)->elements) || 1); \
ASSERT(*((p)->elements - 1 + ((p)->size)) || 1);
+// No: it is possible that top > bottom when using reclaimSpark()
+// ASSERT((p)->bottom >= (p)->top);
+// ASSERT((p)->size > (p)->bottom - (p)->top);
+
// Initialisation
void initSparkPools (void);