mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Do small vector optimization for all communication
I once read years ago somewhere on Stack Overflow that `std::vectors` with that are preinitialized to a default size would allocate the initial capacity on the stack. This of course doesn't make any sense (run time sized stack allocations can cause all kinds of issues), so we were still allocating with our default 64-byte sized buffers, but just not as often.
This commit is contained in:
@@ -593,7 +593,7 @@ void Vst2PluginBridge::do_process(T** inputs, T** outputs, int sample_frames) {
|
||||
}
|
||||
|
||||
// The inputs and outputs arrays should be `[num_inputs][sample_frames]` and
|
||||
// `[num_outputs][sample_frames]` floats large respectfully.
|
||||
// `[num_outputs][sample_frames]` floats large respectfully
|
||||
std::vector<std::vector<T>> input_buffers(plugin.numInputs,
|
||||
std::vector<T>(sample_frames));
|
||||
for (int channel = 0; channel < plugin.numInputs; channel++) {
|
||||
|
||||
Reference in New Issue
Block a user