mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-14 00:02:10 +02:00
Use our new custom std::variant bitsery extension
This prevents reinitializing `std::variant`s when the variant we want to deserialize is already active. We store audio buffers in variants, so reinitializing them results in a lot of unnecessary memory frees, allocations and writes during every processing cycle.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#include <variant>
|
||||
|
||||
#include <bitsery/ext/std_optional.h>
|
||||
#include <bitsery/ext/std_variant.h>
|
||||
#include "../../../bitsery/ext/in-place-variant.h"
|
||||
#include <pluginterfaces/vst/ivstmessage.h>
|
||||
|
||||
#include "../../common.h"
|
||||
@@ -133,7 +133,7 @@ class YaConnectionPoint : public Steinberg::Vst::IConnectionPoint {
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.ext(other,
|
||||
bitsery::ext::StdVariant{
|
||||
bitsery::ext::InPlaceVariant{
|
||||
[](S& s, native_size_t& other_instance_id) {
|
||||
s.value8b(other_instance_id);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user