summaryrefslogtreecommitdiffstats
path: root/src/arena.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2011-06-12 23:46:03 (GMT)
committerJason Evans <je@fb.com>2011-06-13 00:13:39 (GMT)
commitf9a8edbb50f8cbcaf8ed62b36e8d7191ed223d2a (patch)
tree5f443b86ed9f9af17809daa43c0dfda7ff73f29e /src/arena.c
parentf0b22cf932b6fa7be2027a1058802fab0d6e25c6 (diff)
downloadjemalloc-f9a8edbb50f8cbcaf8ed62b36e8d7191ed223d2a.zip
jemalloc-f9a8edbb50f8cbcaf8ed62b36e8d7191ed223d2a.tar.gz
jemalloc-f9a8edbb50f8cbcaf8ed62b36e8d7191ed223d2a.tar.bz2
Fix assertions in arena_purge().
Fix assertions in arena_purge() to accurately reflect the constraints in arena_maybe_purge(). There were two bugs here, one of which merely weakened the assertion, and the other of which referred to an uninitialized variable (typo; used npurgatory instead of arena->npurgatory).
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arena.c b/src/arena.c
index 9aaf47f..e00dccc 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -869,9 +869,9 @@ arena_purge(arena_t *arena, bool all)
assert(ndirty == arena->ndirty);
#endif
assert(arena->ndirty > arena->npurgatory || all);
- assert(arena->ndirty > chunk_npages || all);
+ assert(arena->ndirty - arena->npurgatory > chunk_npages || all);
assert((arena->nactive >> opt_lg_dirty_mult) < (arena->ndirty -
- npurgatory) || all);
+ arena->npurgatory) || all);
#ifdef JEMALLOC_STATS
arena->stats.npurge++;