Prevent allocations caused by Logger::log_trace

C++ would always construct an `std::string` from the string constant
every iteration. Since this also happened when `YABRIDGE_DEBUG_LEVEL` is
not set to 2, this ended up causing unnecessary allocations.
This commit is contained in:
Robbert van der Helm
2021-05-23 00:21:21 +02:00
parent cf2fbf602c
commit df93944f3b
6 changed files with 40 additions and 36 deletions
+6 -6
View File
@@ -663,27 +663,27 @@ void Vst2PluginBridge::process(AEffect* /*plugin*/,
// Technically either `Vst2PluginBridge::process()` or
// `Vst2PluginBridge::process_replacing()` could actually call the other
// function on the plugin depending on what the plugin supports.
logger.log_trace(">> process() :: start");
logger.log_trace([]() { return ">> process() :: start"; });
do_process<float, false>(inputs, outputs, sample_frames);
logger.log_trace(" process() :: end");
logger.log_trace([]() { return " process() :: end"; });
}
void Vst2PluginBridge::process_replacing(AEffect* /*plugin*/,
float** inputs,
float** outputs,
int sample_frames) {
logger.log_trace(">> processReplacing() :: start");
logger.log_trace([]() { return ">> processReplacing() :: start"; });
do_process<float, true>(inputs, outputs, sample_frames);
logger.log_trace(" processReplacing() :: end");
logger.log_trace([]() { return " processReplacing() :: end"; });
}
void Vst2PluginBridge::process_double_replacing(AEffect* /*plugin*/,
double** inputs,
double** outputs,
int sample_frames) {
logger.log_trace(">> processDoubleReplacing() :: start");
logger.log_trace([]() { return ">> processDoubleReplacing() :: start"; });
do_process<double, true>(inputs, outputs, sample_frames);
logger.log_trace(" processDoubleReplacing() :: end");
logger.log_trace([]() { return " processDoubleReplacing() :: end"; });
}
float Vst2PluginBridge::get_parameter(AEffect* /*plugin*/, int index) {