diff options
author | David Robillard <d@drobilla.net> | 2010-01-05 03:51:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-01-05 03:51:50 +0000 |
commit | c67392abf59b500fe405101d7ad896d9da869e47 (patch) | |
tree | 53b5d5b27d4389caa123c5deb2a1e0aadf180ec7 /src/engine/NodeBase.hpp | |
parent | 4c32f20699db0ede850a9485271dfda779761fac (diff) | |
download | ingen-c67392abf59b500fe405101d7ad896d9da869e47.tar.gz ingen-c67392abf59b500fe405101d7ad896d9da869e47.tar.bz2 ingen-c67392abf59b500fe405101d7ad896d9da869e47.zip |
Realtime safe buffer reference handling.
Turns out that dropping a shared_ptr is not realtime safe, even if you use
a realtime safe deleter. Instead, instrusive_ptr is used for buffer
references, so a buffer reference may safely be dropped in the audio
thread (in which case it will be recycled by the BufferFactory).
Faster, cleaner, better.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2341 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/NodeBase.hpp')
-rw-r--r-- | src/engine/NodeBase.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/NodeBase.hpp b/src/engine/NodeBase.hpp index 7a7db8e1..cf7ae0d6 100644 --- a/src/engine/NodeBase.hpp +++ b/src/engine/NodeBase.hpp @@ -21,13 +21,14 @@ #include "types.hpp" #include <string> #include <cstdlib> -#include "raul/Semaphore.hpp" -#include "raul/AtomicInt.hpp" #include "raul/Array.hpp" #include "raul/Atom.hpp" +#include "raul/AtomicInt.hpp" +#include "raul/IntrusivePtr.hpp" +#include "raul/Semaphore.hpp" +#include "contexts.lv2/contexts.h" #include "interface/Port.hpp" #include "NodeImpl.hpp" -#include "contexts.lv2/contexts.h" namespace Ingen { @@ -82,7 +83,7 @@ public: virtual void process(ProcessContext& context) = 0; virtual void post_process(Context& context); - virtual void set_port_buffer(uint32_t voice, uint32_t port_num, SharedPtr<Buffer> buf) {} + virtual void set_port_buffer(uint32_t voice, uint32_t port_num, IntrusivePtr<Buffer> buf) {} virtual void set_buffer_size(BufferFactory& bufs, size_t size); |