webengine/osswebengine/MemoryManager/Src/MemoryPool.cpp
branchRCL_3
changeset 92 e1bea15f9a39
parent 91 30342f40acbf
child 93 79859ed3eea9
equal deleted inserted replaced
91:30342f40acbf 92:e1bea15f9a39
    80     {
    80     {
    81 	if( !iStopScheduler ) return;
    81 	if( !iStopScheduler ) return;
    82     TInt idx = iStoppers.Find( aStopper );
    82     TInt idx = iStoppers.Find( aStopper );
    83     if( idx != KErrNotFound )
    83     if( idx != KErrNotFound )
    84         iStoppers.Remove( idx );
    84         iStoppers.Remove( idx );
       
    85     
       
    86     if(iStoppers.Count() == 0 && iStopScheduler->IsActive()) // cancel stop if nobody is interested
       
    87         iStopScheduler->Cancel();
       
    88         
    85     }
    89     }
    86 
    90 
    87 //-----------------------------------------------------------------------------
    91 //-----------------------------------------------------------------------------
    88 // CMemoryPool::SetNotifier
    92 // CMemoryPool::SetNotifier
    89 //-----------------------------------------------------------------------------
    93 //-----------------------------------------------------------------------------
   488 TAny* CNewSymbianHeapPool::DoAlloc( TUint aSize )
   492 TAny* CNewSymbianHeapPool::DoAlloc( TUint aSize )
   489     {
   493     {
   490     TAny *p = iAlloc->Alloc( aSize );
   494     TAny *p = iAlloc->Alloc( aSize );
   491     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
   495     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
   492         {
   496         {
   493         iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
   497         if(iStopScheduler) iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
   494         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
   498         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
   495         }
   499         }
   496         
   500         
   497     if (!p) {
   501     if (!p) {
   498         ShowOOMDialog();
   502         ShowOOMDialog();
   510     iMemStatus &= ~ERescueOOM;
   514     iMemStatus &= ~ERescueOOM;
   511 
   515 
   512     TAny* p = iAlloc->ReAlloc( aPtr, aSize );
   516     TAny* p = iAlloc->ReAlloc( aPtr, aSize );
   513     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
   517     if(iAlloc->isLowSystemMemory && p) // use this a pre OOM indicator
   514         {
   518         {
   515         iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
   519         if(iStopScheduler) iStopScheduler->Start( CStopScheduler::ECheckMemory, 0 );                
   516         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
   520         iAlloc->isLowSystemMemory = 0; // reset so that we don't check before next request for RAM
   517         }
   521         }
   518 
   522 
   519     // check memory manager status
   523     // check memory manager status
   520     if( !p || iMemStatus & ERescueOOM )
   524     if( !p || iMemStatus & ERescueOOM )