Commit a650cec6 authored by Simon Marlow's avatar Simon Marlow
Browse files

fix ASSERT_SPARK_POOL_INVARIANTS(): top>bottom is valid

parent 99836ac3
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment