diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-06 19:13:54 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-06 19:13:54 +0100 |
commit | 77d12b490ed05e1257eb638ee47f55268b4dcfeb (patch) | |
tree | e7f2963b126abb50b8be1330d1ac98975c1cefbb /libs | |
parent | 50556db40561cf75d2b72fde26c837395d54a36a (diff) |
RT-safety use stack (not heap) for plugin pin mappings
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/chan_mapping.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h index 07b623f8e1..cc42ed01bc 100644 --- a/libs/ardour/ardour/chan_mapping.h +++ b/libs/ardour/ardour/chan_mapping.h @@ -25,13 +25,14 @@ #include <ostream> #include <utility> +#include "pbd/stack_allocator.h" #include "pbd/xml++.h" + #include "ardour/data_type.h" #include "ardour/chan_count.h" namespace ARDOUR { - /** A mapping from one set of channels to another. * The general form is 1 source (from), many sinks (to). * numeric IDs are used to identify sources and sinks. @@ -103,8 +104,8 @@ public: */ bool is_subset (const ChanMapping& superset) const; - typedef std::map<uint32_t, uint32_t> TypeMapping; - typedef std::map<DataType, TypeMapping> Mappings; + typedef std::map<uint32_t, uint32_t, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, uint32_t>, 16> > TypeMapping; + typedef std::map<DataType, TypeMapping, std::less<DataType>, PBD::StackAllocator<std::pair<const DataType, TypeMapping>, 2> > Mappings; Mappings mappings() { return _mappings; } const Mappings& mappings() const { return _mappings; } diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 68c1aaa604..003df28a38 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -29,6 +29,7 @@ #include <boost/weak_ptr.hpp> +#include "pbd/stack_allocator.h" #include "pbd/timing.h" #include "ardour/ardour.h" @@ -370,7 +371,8 @@ private: /* ordered map [plugin instance ID] => ARDOUR::ChanMapping * TODO: consider replacing with boost::flat_map<> or std::vector<>. */ - class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping> { + class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, ARDOUR::ChanMapping>, 4> > + { public: /* this emulates C++11's std::map::at() * return mapping for given plugin instance */ |