Fix the "epoch" mallctl.

Fix the "epoch" mallctl to update cached stats even if the passed in
epoch is 0.
This commit is contained in:
Jason Evans 2012-04-25 13:12:46 -07:00
parent f54166e7ef
commit 6b9ed67b4b
2 changed files with 13 additions and 12 deletions

View File

@ -81,6 +81,8 @@ found in the git revision history:
- Check for NULL pointer in malloc_usable_size().
- Fix an off-by-one heap profile statistics bug that could be observed in
interval- and growth-triggered heap profiles.
- Fix the "epoch" mallctl to update cached stats even if the passed in epoch
is 0.
- Fix bin->runcur management to fix a layout policy bug. This bug did not
affect correctness.
- Fix a bug in choose_arena_hard() that potentially caused more arenas to be

View File

@ -1004,9 +1004,8 @@ epoch_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
uint64_t newval;
malloc_mutex_lock(&ctl_mtx);
newval = 0;
WRITE(newval, uint64_t);
if (newval != 0)
if (newp != NULL)
ctl_refresh();
READ(ctl_epoch, uint64_t);