summaryrefslogtreecommitdiffstats
path: root/tools/profiler/core/PowerCounters-mac-amd64.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /tools/profiler/core/PowerCounters-mac-amd64.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tools/profiler/core/PowerCounters-mac-amd64.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/profiler/core/PowerCounters-mac-amd64.cpp b/tools/profiler/core/PowerCounters-mac-amd64.cpp
index 540cee155d..c5a82694cd 100644
--- a/tools/profiler/core/PowerCounters-mac-amd64.cpp
+++ b/tools/profiler/core/PowerCounters-mac-amd64.cpp
@@ -350,13 +350,7 @@ class RAPL {
}
}
- ~RAPL() {
- free(mPkes);
- delete mPkg;
- delete mCores;
- delete mGpu;
- delete mRam;
- }
+ ~RAPL() { free(mPkes); }
void Sample() {
constexpr uint64_t kSupportedVersion = 1;
@@ -403,14 +397,14 @@ class RAPL {
PowerCounters::PowerCounters() {
// RAPL values are global, so only sample them on the parent.
- mRapl = XRE_IsParentProcess() ? new RAPL(mCounters) : nullptr;
+ if (XRE_IsParentProcess()) {
+ mRapl = mozilla::MakeUnique<RAPL>(mCounters);
+ }
}
-PowerCounters::~PowerCounters() {
- mCounters.clear();
- delete mRapl;
- mRapl = nullptr;
-}
+// This default destructor can not be defined in the header file as it depends
+// on the full definition of RAPL which lives in this file.
+PowerCounters::~PowerCounters() {}
void PowerCounters::Sample() {
if (mRapl) {