Avoid allocations when reconstructing process data

This commit is contained in:
Robbert van der Helm
2021-05-07 18:21:30 +02:00
parent 814d3c688c
commit 93b8643cba
4 changed files with 85 additions and 76 deletions
+2 -4
View File
@@ -1261,12 +1261,10 @@ size_t Vst3Bridge::register_object_instance(
true, *request.new_realtime_priority);
}
// TODO: This `get()` now moves data. We should avoid
// that, since that would require reallocating the
// process data next iteration.
const tresult result =
object_instances[request.instance_id]
.audio_processor->process(request.data.get());
.audio_processor->process(
request.data.reconstruct());
return YaAudioProcessor::ProcessResponse{
.result = result,