зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1698524: Clear profiler memory counter on re-enabling of the profiler r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D108447
This commit is contained in:
Родитель
09ab7490d6
Коммит
ded16fcdaa
|
@ -547,6 +547,8 @@ void install_memory_hooks() {
|
|||
// Also initialize the ThreadIntercept, even if native allocation tracking
|
||||
// won't be turned on. This way the TLS will be initialized.
|
||||
ThreadIntercept::Init();
|
||||
} else {
|
||||
sCounter->Clear();
|
||||
}
|
||||
jemalloc_replace_dynamic(replace_init);
|
||||
}
|
||||
|
|
|
@ -110,6 +110,14 @@ class BaseProfilerCount {
|
|||
# endif
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
*mCounter = 0;
|
||||
// We don't reset *mNumber or mPrevNumber. We encode numbers as
|
||||
// positive deltas, and currently we only care about the deltas (for
|
||||
// e.g. heatmaps). If we ever need to clear mNumber as well, we can an
|
||||
// alternative method (Reset()) to do so.
|
||||
}
|
||||
|
||||
// We don't define ++ and Add() here, since the static defines directly
|
||||
// increment the atomic counters, and the subclasses implement ++ and
|
||||
// Add() directly.
|
||||
|
|
Загрузка…
Ссылка в новой задаче