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:
Robbert van der Helm
2021-05-07 17:00:43 +02:00
parent fcaac219a6
commit 671587f981
5 changed files with 49 additions and 6 deletions
@@ -220,12 +220,15 @@ Vst3PluginProxyImpl::process(Steinberg::Vst::ProcessData& data) {
process_request.data.repopulate(data);
process_request.new_realtime_priority = new_realtime_priority;
ProcessResponse response = bridge.send_audio_processor_message(
MessageReference<YaAudioProcessor::Process>(process_request));
// We'll also receive the response into an existing object so we can also
// avoid heap allocations there
bridge.receive_audio_processor_message_into(
MessageReference<YaAudioProcessor::Process>(process_request),
process_response);
response.output_data.write_back_outputs(data);
process_response.output_data.write_back_outputs(data);
return response.result;
return process_response.result;
}
uint32 PLUGIN_API Vst3PluginProxyImpl::getTailSamples() {