mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-29 02:40:33 +09:00
1325254 - optimize TimerThread data structures
1325254 P1 Make TimerThread::mTimers store RefPtr<nsTimerImpl> objects. 1325254 P2 Make TimerThread list store an entry struct and just drop nsTimerImpl ref on cancel. 1325254 P3 Sort TimerThread list as a binary heap. 1325254 P4 Dynamically allocate Entry structs stored in TimerThread::mTimers. 1325254 P5 Make nsITimer::Cancel() O(c).
This commit is contained in:
parent
be3e4b917d
commit
f109b02bc3
4 changed files with 157 additions and 43 deletions
|
|
@ -142,6 +142,7 @@ nsTimer::Release(void)
|
|||
}
|
||||
|
||||
nsTimerImpl::nsTimerImpl(nsITimer* aTimer) :
|
||||
mHolder(nullptr),
|
||||
mGeneration(0),
|
||||
mDelay(0),
|
||||
mITimer(aTimer),
|
||||
|
|
@ -647,6 +648,12 @@ nsTimerImpl::LogFiring(const Callback& aCallback, uint8_t aType, uint32_t aDelay
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTimerImpl::SetHolder(nsTimerImplHolder* aHolder)
|
||||
{
|
||||
mHolder = aHolder;
|
||||
}
|
||||
|
||||
nsTimer::~nsTimer()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue