#include <sigc++/signal.h>
#include <glibmm/thread.h>
+#include <boost/pool/pool.hpp>
+#include <boost/pool/pool_alloc.hpp>
+
#include <pbd/undo.h>
#include <pbd/xml++.h>
#include <pbd/statefuldestructible.h>
double* coeff; ///< double[4] allocated by Curve as needed
};
+/* automation lists use a pool allocator that does not use a lock and
+ allocates 8k of new pointers at a time
+*/
+
+typedef boost::fast_pool_allocator<ControlEvent*,
+ boost::default_user_allocator_new_delete,
+ boost::details::pool::null_mutex,
+ 8192> ControlEventAllocator;
class AutomationList : public PBD::StatefulDestructible
{
public:
- typedef std::list<ControlEvent*> EventList;
+ typedef std::list<ControlEvent*,ControlEventAllocator> EventList;
typedef EventList::iterator iterator;
+ typedef EventList::reverse_iterator reverse_iterator;
typedef EventList::const_iterator const_iterator;
AutomationList (Parameter id, double min_val, double max_val, double default_val);
Glib::Mutex& lock() const { return _lock; }
LookupCache& lookup_cache() const { return _lookup_cache; }
SearchCache& search_cache() const { return _search_cache; }
-
+
/** Called by locked entry point and various private
* locations where we already hold the lock.
*
*/
double unlocked_eval (double x) const;
- bool rt_safe_earliest_event (double start, double end, double& x, double& y) const;
+ bool rt_safe_earliest_event (double start, double end, double& x, double& y, bool start_inclusive=false) const;
+ bool rt_safe_earliest_event_unlocked (double start, double end, double& x, double& y, bool start_inclusive=false) const;
Curve& curve() { return *_curve; }
const Curve& curve() const { return *_curve; }
void build_search_cache_if_necessary(double start, double end) const;
- bool rt_safe_earliest_event_discrete (double start, double end, double& x, double& y) const;
- bool rt_safe_earliest_event_linear (double start, double end, double& x, double& y) const;
+ bool rt_safe_earliest_event_discrete_unlocked (double start, double end, double& x, double& y, bool inclusive) const;
+ bool rt_safe_earliest_event_linear_unlocked (double start, double end, double& x, double& y, bool inclusive) const;
AutomationList* cut_copy_clear (double, double, int op);