# HG changeset patch # User Chris Cannam # Date 1138385047 0 # Node ID b101cc2ae1ab81a4f2d6bb2574fa8b5e30c067a1 # Parent 1fa7cc0d008b60fc4090cc33a6b0f24a306eabbd * Introduce potentially-separate read and write ring buffers, so we can swap in a new set when something changes -- thus allowing us to respond quickly when something changes during playback, without losing the long buffers * Some fixes for display & editing diff -r 1fa7cc0d008b -r b101cc2ae1ab base/Scavenger.h --- a/base/Scavenger.h Thu Jan 26 18:01:38 2006 +0000 +++ b/base/Scavenger.h Fri Jan 27 18:04:07 2006 +0000 @@ -48,7 +48,7 @@ * Call from a non-RT thread. * Only one thread should be calling this on any given scavenger. */ - void scavenge(); + void scavenge(bool clearNow = false); protected: typedef std::pair ObjectTimePair; @@ -121,7 +121,7 @@ template void -Scavenger::scavenge() +Scavenger::scavenge(bool clearNow) { // std::cerr << "Scavenger::scavenge: scavenged " << m_scavenged << ", claimed " << m_claimed << std::endl; @@ -133,7 +133,8 @@ for (size_t i = 0; i < m_objects.size(); ++i) { ObjectTimePair &pair = m_objects[i]; - if (pair.first != 0 && pair.second + m_sec < sec) { + if (clearNow || + (pair.first != 0 && pair.second + m_sec < sec)) { T *ot = pair.first; pair.first = 0; delete ot;