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).
This commit is contained in:
Jason Evans 2011-06-12 16:46:03 -07:00
parent f0b22cf932
commit f9a8edbb50

View File

@ -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++;