mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 04:19:59 +02:00
Make sure effProcessEvents() also never allocates
This basically changes the default small vectors during VST2 event processing from 256 bytes to the size of a `DynamicVstEvents` object (which also includes a small_vector to hold MIDI events without allocating) and makes them thread local. We already have a similar optimization for VST3. There it's a bit neater since we already had to separate audio processing functions from non-time critical functions. Here we don't have that separation, so we just made these buffers thread local, large enough to hold our predefined number of events, and we then just shrink them to fit if these buffers grow even more (which can only happen after reading or writing chunk data). The change doesn't specifically target `effProcessEvents()`, but that's where you would see the differences. This is also relevant for `audioMasterProcessEvents()`.
This commit is contained in:
@@ -74,7 +74,8 @@ intptr_t DefaultDataConverter::return_value(const int /*opcode*/,
|
||||
|
||||
Vst2EventResult DefaultDataConverter::send_event(
|
||||
boost::asio::local::stream_protocol::socket& socket,
|
||||
const Vst2Event& event) const {
|
||||
write_object(socket, event);
|
||||
return read_object<Vst2EventResult>(socket);
|
||||
const Vst2Event& event,
|
||||
SerializationBufferBase& buffer) const {
|
||||
write_object(socket, event, buffer);
|
||||
return read_object<Vst2EventResult>(socket, buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user