diff base/Scavenger.h @ 1527:710e6250a401 zoom

Merge from default branch
author Chris Cannam
date Mon, 17 Sep 2018 13:51:14 +0100
parents 48e9f538e6e9
children ad5f892c0c4d
line wrap: on
line diff
--- a/base/Scavenger.h	Mon Dec 12 15:18:52 2016 +0000
+++ b/base/Scavenger.h	Mon Sep 17 13:51:14 2018 +0100
@@ -106,15 +106,15 @@
 Scavenger<T>::~Scavenger()
 {
     if (m_scavenged < m_claimed) {
-	for (size_t i = 0; i < m_objects.size(); ++i) {
-	    ObjectTimePair &pair = m_objects[i];
-	    if (pair.first != 0) {
-		T *ot = pair.first;
-		pair.first = 0;
-		delete ot;
-		++m_scavenged;
-	    }
-	}
+        for (size_t i = 0; i < m_objects.size(); ++i) {
+            ObjectTimePair &pair = m_objects[i];
+            if (pair.first != 0) {
+                T *ot = pair.first;
+                pair.first = 0;
+                delete ot;
+                ++m_scavenged;
+            }
+        }
     }
 
     clearExcess(0);
@@ -131,17 +131,17 @@
     time_t sec = tv.tv_sec;
 
     for (size_t i = 0; i < m_objects.size(); ++i) {
-	ObjectTimePair &pair = m_objects[i];
-	if (pair.first == 0) {
-	    pair.second = sec;
-	    pair.first = t;
-	    ++m_claimed;
-	    return;
-	}
+        ObjectTimePair &pair = m_objects[i];
+        if (pair.first == 0) {
+            pair.second = sec;
+            pair.first = t;
+            ++m_claimed;
+            return;
+        }
     }
 
     std::cerr << "WARNING: Scavenger::claim(" << t << "): run out of slots, "
-	      << "using non-RT-safe method" << std::endl;
+              << "using non-RT-safe method" << std::endl;
     pushExcess(t);
 }
 
@@ -158,14 +158,14 @@
     time_t sec = tv.tv_sec;
 
     for (size_t i = 0; i < m_objects.size(); ++i) {
-	ObjectTimePair &pair = m_objects[i];
-	if (clearNow ||
-	    (pair.first != 0 && pair.second + m_sec < sec)) {
-	    T *ot = pair.first;
-	    pair.first = 0;
-	    delete ot;
-	    ++m_scavenged;
-	}
+        ObjectTimePair &pair = m_objects[i];
+        if (clearNow ||
+            (pair.first != 0 && pair.second + m_sec < sec)) {
+            T *ot = pair.first;
+            pair.first = 0;
+            delete ot;
+            ++m_scavenged;
+        }
     }
 
     if (sec > m_lastExcess + m_sec) {
@@ -191,8 +191,8 @@
 {
     m_excessMutex.lock();
     for (typename ObjectList::iterator i = m_excess.begin();
-	 i != m_excess.end(); ++i) {
-	delete *i;
+         i != m_excess.end(); ++i) {
+        delete *i;
     }
     m_excess.clear();
     m_lastExcess = sec;