Ejemplo n.º 1
0
void ProxyDestinationMap::setResetTimer(std::chrono::milliseconds interval) {
  assert(interval.count() > 0);
  inactivityTimeout_ = static_cast<uint32_t>(interval.count());
  resetTimer_ =
      folly::AsyncTimeout::make(proxy_->eventBase(), [this]() noexcept {
        resetAllInactive();
        scheduleTimer(false /* initialAttempt */);
      });
  scheduleTimer(true /* initialAttempt */);
}
Ejemplo n.º 2
0
void MC6845::notify(OEComponent *sender, int notification, void *data)
{
    if (sender == controlBus)
    {
        switch (notification)
        {
            case CONTROLBUS_POWERSTATE_DID_CHANGE:
                powerState = *((ControlBusPowerState *)data);
                
                updateVideoEnabled();
                
                break;
                
            case CONTROLBUS_TIMER_DID_FIRE:
                scheduleTimer(((ControlBusTimer *)data)->cycles);
                
                break;
                
            case CONTROLBUS_RESET_DID_ASSERT:
                inReset = true;
                
                updateVideoEnabled();
                
                break;
                
            case CONTROLBUS_RESET_DID_CLEAR:
                inReset = false;
                
                updateVideoEnabled();
                
                break;
        }
    }
}
Ejemplo n.º 3
0
void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>& blockSnapshot)
{
    m_blocksToSweep.resize(blockSnapshot.size());
    CopyFunctor functor(m_blocksToSweep);
    m_globalData->heap.objectSpace().forEachBlock(functor);
    m_currentBlockToSweepIndex = 0;
    m_structuresCanBeSwept = false;
    scheduleTimer();
}
void DefaultGCActivityCallback::didAllocate(size_t bytes)
{
    // The first byte allocated in an allocation cycle will report 0 bytes to didAllocate. 
    // We pretend it's one byte so that we don't ignore this allocation entirely.
    if (!bytes)
        bytes = 1;
    Heap* heap = static_cast<Heap*>(&m_vm->heap);
    double gcTimeSlice = std::min((static_cast<double>(bytes) / MB) * gcTimeSlicePerMB, maxGCTimeSlice);
    double newDelay = heap->lastGCLength() / gcTimeSlice;
    scheduleTimer(newDelay);
}
Ejemplo n.º 5
0
void GCActivityCallback::doWork()
{
    Heap* heap = &m_vm->heap;
    if (!isEnabled())
        return;
    
    JSLockHolder locker(m_vm);
    if (heap->isDeferred()) {
        scheduleTimer(0);
        return;
    }

    doCollection();
}
Ejemplo n.º 6
0
void IncrementalSweeper::doSweep(double sweepBeginTime)
{
    while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) {
        sweepNextBlock();

        double elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime;
        if (elapsedTime < sweepTimeSlice)
            continue;

        scheduleTimer();
        return;
    }

    m_blocksToSweep.clear();
    cancelTimer();
}
Ejemplo n.º 7
0
void GCActivityCallback::didAllocate(size_t bytes)
{
#if PLATFORM(EFL)
    if (!isEnabled())
        return;

    ASSERT(WTF::isMainThread());
#endif

    // The first byte allocated in an allocation cycle will report 0 bytes to didAllocate. 
    // We pretend it's one byte so that we don't ignore this allocation entirely.
    if (!bytes)
        bytes = 1;
    double bytesExpectedToReclaim = static_cast<double>(bytes) * deathRate();
    double newDelay = lastGCLength() / gcTimeSlice(bytesExpectedToReclaim);
    scheduleTimer(newDelay);
}
Ejemplo n.º 8
0
void MC6845::updateTiming()
{
    float controlBusClockFrequency;
    controlBus->postMessage(this, CONTROLBUS_GET_CLOCKFREQUENCY, &controlBusClockFrequency);
    clockMultiplier = clockFrequency / controlBusClockFrequency;
    
    vertTotal = vertTotalCell * scanline + vertTotalAdjust;
    vertDisplayed = vertDisplayedCell * scanline;
    vertSyncPosition = vertSyncPositionCell * scanline;
    
    frameCycleNum = horizTotal * vertTotal;
    
    controlBus->postMessage(this, CONTROLBUS_GET_CYCLES, &lastCycles);
    
    OEInt id = 0;
    controlBus->postMessage(this, CONTROLBUS_INVALIDATE_TIMERS, &id);
    
    scheduleTimer(0);
    
    refreshVideo();
}
Ejemplo n.º 9
0
void DefaultGCActivityCallback::doWork()
{
    Heap* heap = &m_vm->heap;
    if (!isEnabled())
        return;
    
    JSLockHolder locker(m_vm);
    if (heap->isDeferred()) {
        scheduleTimer(0);
        return;
    }

#if !PLATFORM(IOS)
    double startTime = WTF::monotonicallyIncreasingTime();
    if (heap->isPagedOut(startTime + pagingTimeOut)) {
        heap->activityCallback()->cancel();
        heap->increaseLastGCLength(pagingTimeOut);
        return;
    }
#endif
    heap->gcTimerDidFire();
    heap->collect();
}
Ejemplo n.º 10
0
void DefaultGCActivityCallback::didAbandonObjectGraph()
{
    scheduleTimer(d.get());
}
Ejemplo n.º 11
0
void DefaultGCActivityCallback::didAllocate(size_t bytes)
{
    if (bytes < minBytesBeforeCollect)
        return;
    scheduleTimer(d.get());
}
Ejemplo n.º 12
0
void IncrementalSweeper::startSweeping(Vector<MarkedBlock*>& blockSnapshot)
{
    m_blocksToSweep = blockSnapshot;
    m_currentBlockToSweepIndex = 0;
    scheduleTimer();
}
Ejemplo n.º 13
0
 /*
 // repeating timer
 long setInterval(Function handler, optional long timeout, any... args);
 long setInterval([AllowAny] DOMString handler, optional long timeout, any... args);
 void clearInterval(long handle);
 */
 static v8::Handle<v8::Value> v8setInterval( const v8::Arguments& args ){
   v8::HandleScope handlescope;
   scheduleTimer( args, true );
 }
Ejemplo n.º 14
0
 /*
 // one-shot timer
 long setTimeout(Function handler, optional long timeout, any... args);
 long setTimeout([AllowAny] DOMString handler, optional long timeout, any... args);
 void clearTimeout(long handle);
 TODO: arguments
 */
 static v8::Handle<v8::Value> v8setTimeout( const v8::Arguments& args ){
   v8::HandleScope handlescope;
   return scheduleTimer( args, false );
 }