Fix --disable-stats support.

Fix numerous regressions that were exposed by --disable-stats, both in
the core library and in the tests.
This commit is contained in:
Jason Evans
2017-01-18 23:03:37 -08:00
parent 66bf773ef2
commit 9eb1b1c881
5 changed files with 252 additions and 198 deletions

View File

@@ -820,9 +820,11 @@ extent_alloc_retained(tsdn_t *tsdn, arena_t *arena,
extent = extent_recycle(tsdn, arena, r_extent_hooks,
arena->extents_retained, false, false, new_addr, usize, pad,
alignment, zero, commit, slab);
if (extent != NULL && config_stats) {
size_t size = usize + pad;
arena->stats.retained -= size;
if (extent != NULL) {
if (config_stats) {
size_t size = usize + pad;
arena->stats.retained -= size;
}
if (config_prof)
extent_gprof_add(tsdn, extent);
}