mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 20:40:03 +02:00
Further reduce allocations by reusing responses
On the plugin's side, still need to do a lot of work on the Wine side of things.
This commit is contained in:
@@ -50,14 +50,14 @@ class DefaultDataConverter {
|
||||
const intptr_t value) const;
|
||||
|
||||
/**
|
||||
* Write the reponse back to the `data` pointer.
|
||||
* Write the response back to the `data` pointer.
|
||||
*/
|
||||
virtual void write(const int opcode,
|
||||
void* data,
|
||||
const EventResult& response) const;
|
||||
|
||||
/**
|
||||
* Write the reponse back to the `value` pointer. This is only used during
|
||||
* Write the response back to the `value` pointer. This is only used during
|
||||
* the `effGetSpeakerArrangement` event.
|
||||
*/
|
||||
virtual void write_value(const int opcode,
|
||||
|
||||
@@ -462,6 +462,24 @@ class Vst3Sockets : public Sockets {
|
||||
audio_processor_buffers.at(object_ref.get().instance_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Alternative to `send_audio_processor_message()` for use with
|
||||
* `MessageReference<T>`, where we also want deserialize into an existing
|
||||
* object to prevent allocations. Used during audio processing.q
|
||||
*
|
||||
* TODO: Think of a better name for this
|
||||
*/
|
||||
template <typename T>
|
||||
typename T::Response& receive_audio_processor_message_into(
|
||||
const MessageReference<T>& request_ref,
|
||||
typename T::Response& response_ref,
|
||||
std::optional<std::pair<Vst3Logger&, bool>> logging) {
|
||||
return audio_processor_sockets.at(request_ref.get().instance_id)
|
||||
.receive_into(
|
||||
request_ref, response_ref, logging,
|
||||
audio_processor_buffers.at(request_ref.get().instance_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* For sending messages from the host to the plugin. After we have a better
|
||||
* idea of what our communication model looks like we'll probably want to
|
||||
|
||||
Reference in New Issue
Block a user