Changeset 26627 in vbox
- Timestamp:
- Feb 18, 2010 1:12:34 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57830
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r26582 r26627 1312 1312 // entries and free one element if there's still no space (if needed). 1313 1313 PRIntervalTime now = PR_IntervalNow(); 1314 do { 1314 while (!g_ClientDownList.empty()) 1315 { 1315 1316 ClientDownInfo *cInfo = g_ClientDownList.back(); 1316 if (!cInfo)1317 break;1318 1317 PRInt64 diff = (PRInt64)now - cInfo->uTimestamp; 1319 1318 if (diff < 0) … … 1323 1322 g_ClientDownMap.erase(cInfo->uClient); 1324 1323 g_ClientDownList.pop_back(); 1324 NS_ASSERTION(g_ClientDownMap.size() == g_ClientDownList.size(), 1325 "client down info inconsistency during expiry"); 1325 1326 delete cInfo; 1326 1327 } 1327 1328 else 1328 1329 break; 1329 } while (true);1330 } 1330 1331 1331 1332 ClientDownMap::iterator it = g_ClientDownMap.find(aSenderID); 1332 1333 if (it == g_ClientDownMap.end()) 1333 1334 { 1334 while (g_ClientDownList.size() >= MAX_CLIENT_DOWN_SIZE) 1335 /* Getting size of a map is O(1), size of a list can be O(n). */ 1336 while (g_ClientDownMap.size() >= MAX_CLIENT_DOWN_SIZE) 1335 1337 { 1336 1338 ClientDownInfo *cInfo = g_ClientDownList.back(); 1337 1339 g_ClientDownMap.erase(cInfo->uClient); 1338 1340 g_ClientDownList.pop_back(); 1341 NS_ASSERTION(g_ClientDownMap.size() == g_ClientDownList.size(), 1342 "client down info inconsistency during emergency evicting"); 1339 1343 delete cInfo; 1340 1344 } … … 1343 1347 g_ClientDownMap[aSenderID] = cInfo; 1344 1348 g_ClientDownList.push_front(cInfo); 1349 NS_ASSERTION(g_ClientDownMap.size() == g_ClientDownList.size(), 1350 "client down info inconsistency after adding entry"); 1345 1351 } 1346 1352 return (aSenderID == mPeer) ? NS_OK : IPC_WAIT_NEXT_MESSAGE; … … 1356 1362 g_ClientDownMap.erase(it); 1357 1363 g_ClientDownList.remove(cInfo); 1364 NS_ASSERTION(g_ClientDownMap.size() == g_ClientDownList.size(), 1365 "client down info inconsistency in client up case"); 1358 1366 delete cInfo; 1359 1367 }
Note:
See TracChangeset
for help on using the changeset viewer.