зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1373436 (part 2) - Use a UniquePtr for CorePS::mLul. r=mstange.
This commit is contained in:
Родитель
8d89035364
Коммит
442ac55216
|
@ -259,9 +259,9 @@ Sampler::Sampler(PSLockRef aLock)
|
|||
bool createdLUL = false;
|
||||
lul::LUL* lul = CorePS::Lul(aLock);
|
||||
if (!lul) {
|
||||
lul = new lul::LUL(logging_sink_for_LUL);
|
||||
CorePS::SetLul(aLock, lul);
|
||||
CorePS::SetLul(aLock, MakeUnique<lul::LUL>(logging_sink_for_LUL));
|
||||
// Read all the unwind info currently available.
|
||||
lul = CorePS::Lul(aLock);
|
||||
read_procmaps(lul);
|
||||
createdLUL = true;
|
||||
}
|
||||
|
|
|
@ -185,10 +185,6 @@ private:
|
|||
delete mDeadThreads.back();
|
||||
mDeadThreads.pop_back();
|
||||
}
|
||||
|
||||
#if defined(USE_LUL_STACKWALK)
|
||||
delete mLul;
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -243,7 +239,11 @@ public:
|
|||
PS_GET(ThreadVector&, DeadThreads)
|
||||
|
||||
#ifdef USE_LUL_STACKWALK
|
||||
PS_GET_AND_SET(lul::LUL*, Lul)
|
||||
static lul::LUL* Lul(PSLockRef) { return sInstance->mLul.get(); }
|
||||
static void SetLul(PSLockRef, UniquePtr<lul::LUL> aLul)
|
||||
{
|
||||
sInstance->mLul = Move(aLul);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -263,7 +263,7 @@ private:
|
|||
|
||||
#ifdef USE_LUL_STACKWALK
|
||||
// LUL's state. Null prior to the first activation, non-null thereafter.
|
||||
lul::LUL* mLul;
|
||||
UniquePtr<lul::LUL> mLul;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче