void TimerBase::heapDecreaseKey() { ASSERT(m_nextFireTime != 0); checkHeapIndex(); push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1)); checkHeapIndex(); }
void TimerBase::heapPopMin() { ASSERT(this == timerHeap().first()); checkHeapIndex(); pop_heap(TimerHeapIterator(0), TimerHeapIterator(timerHeap().size())); checkHeapIndex(); ASSERT(this == timerHeap().last()); }
void TimerBase::heapDecreaseKey() { ASSERT(m_nextFireTime != 0); checkHeapIndex(); TimerBase** heapData = timerHeap().data(); push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapIndex + 1), TimerHeapLessThanFunction()); checkHeapIndex(); }
void TimerBase::heapPopMin() { ASSERT(this == timerHeap().first()); checkHeapIndex(); Vector<TimerBase*>& heap = timerHeap(); TimerBase** heapData = heap.data(); pop_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + heap.size()), TimerHeapLessThanFunction()); checkHeapIndex(); ASSERT(this == timerHeap().last()); }
inline void TimerBase::checkConsistency() const { // Timers should be in the heap if and only if they have a non-zero next fire time. ASSERT(inHeap() == (m_nextFireTime != 0)); if (inHeap()) checkHeapIndex(); }