summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2014-08-07 06:38:39 (GMT)
committerJason Evans <jasone@canonware.com>2016-12-06 18:53:51 (GMT)
commit1ba886fb6983e795dc12f6f2c6cf3159481c0c5d (patch)
tree13b321407d860c02a2fece6b04f3332d8d61c43f
parent46c0af68bd248b04df75e4f92d5fb804c3d75340 (diff)
downloadjemalloc-1ba886fb6983e795dc12f6f2c6cf3159481c0c5d.zip
jemalloc-1ba886fb6983e795dc12f6f2c6cf3159481c0c5d.tar.gz
jemalloc-1ba886fb6983e795dc12f6f2c6cf3159481c0c5d.tar.bz2
Fix the cactive statistic.
Fix the cactive statistic to decrease (rather than increase) when active memory decreases. This regression was introduced by aa5113b1fdafd1129c22512837c6c3d66c295fc8 (Refactor overly large/complex functions) and first released in 3.5.0.
-rw-r--r--src/arena.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arena.c b/src/arena.c
index dad707b..99bdb8e 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -358,9 +358,9 @@ arena_cactive_update(arena_t *arena, size_t add_pages, size_t sub_pages)
{
if (config_stats) {
- ssize_t cactive_diff = CHUNK_CEILING((arena->nactive +
- add_pages) << LG_PAGE) - CHUNK_CEILING((arena->nactive -
- sub_pages) << LG_PAGE);
+ ssize_t cactive_diff = CHUNK_CEILING((arena->nactive + add_pages
+ - sub_pages) << LG_PAGE) - CHUNK_CEILING(arena->nactive <<
+ LG_PAGE);
if (cactive_diff != 0)
stats_cactive_add(cactive_diff);
}