Implement the prof.gdump mallctl.

This feature makes it possible to toggle the gdump feature on/off during
program execution, whereas the the opt.prof_dump mallctl value can only
be set during program startup.

This resolves #72.
This commit is contained in:
Jason Evans
2015-01-25 21:16:57 -08:00
parent 41f2e692f6
commit 5b8ed5b7c9
7 changed files with 133 additions and 10 deletions

View File

@@ -213,7 +213,8 @@ chunk_register(void *chunk, size_t size, bool base)
} else if (config_prof)
gdump = false;
malloc_mutex_unlock(&chunks_mtx);
if (config_prof && opt_prof && opt_prof_gdump && gdump)
if (config_prof && opt_prof && prof_gdump_get_unlocked() &&
gdump)
prof_gdump();
}
if (config_valgrind)