Fix the cactive statistic.

Fix the cactive statistic to decrease (rather than increase) when active
memory decreases.  This regression was introduced by
aa5113b1fd (Refactor overly large/complex
functions) and first released in 3.5.0.
This commit is contained in:
Jason Evans 2014-08-06 23:38:39 -07:00
parent a2ea54c986
commit 1522937e9c

View File

@ -382,9 +382,9 @@ arena_cactive_update(arena_t *arena, size_t add_pages, size_t sub_pages)
{ {
if (config_stats) { if (config_stats) {
ssize_t cactive_diff = CHUNK_CEILING((arena->nactive + ssize_t cactive_diff = CHUNK_CEILING((arena->nactive + add_pages
add_pages) << LG_PAGE) - CHUNK_CEILING((arena->nactive - - sub_pages) << LG_PAGE) - CHUNK_CEILING(arena->nactive <<
sub_pages) << LG_PAGE); LG_PAGE);
if (cactive_diff != 0) if (cactive_diff != 0)
stats_cactive_add(cactive_diff); stats_cactive_add(cactive_diff);
} }