Swap Boost.Container's small_vector out for LLVM's

This implementation misses a shrink to fit function, but reassigning the
vector with a fresh one should be equivalent.
This commit is contained in:
Robbert van der Helm
2022-04-14 23:31:14 +02:00
parent fd25010aca
commit b2a15620f3
18 changed files with 1601 additions and 97 deletions
+3 -6
View File
@@ -16,18 +16,15 @@
#pragma once
#include <llvm/small-vector.h>
#include <pluginterfaces/vst/ivstevents.h>
#include <boost/container/small_vector.hpp>
#include "../../bitsery/ext/in-place-variant.h"
#include "../../bitsery/traits/small-vector.h"
#include "base.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
// FIXME: When used in a Boost.Containers small vector, GCC somehow complains
// that the fields in `YaEvent` may be uninitialized (during the
// deserialization). This warning only shows up during a unity build.
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
/**
* A wrapper around `DataEvent` for serialization purposes, as this event
@@ -270,7 +267,7 @@ class YaEventList : public Steinberg::Vst::IEventList {
}
private:
boost::container::small_vector<YaEvent, 64> events_;
llvm::SmallVector<YaEvent, 64> events_;
};
#pragma GCC diagnostic pop
@@ -16,20 +16,14 @@
#pragma once
#include <llvm/small-vector.h>
#include <pluginterfaces/vst/ivstparameterchanges.h>
#include <boost/container/small_vector.hpp>
#include "../../bitsery/traits/small-vector.h"
#include "base.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
// FIXME: When used in a Boost.Containers small vector, GCC somehow complains
// that the fields in this class may be uninitialized (during the
// deserialization). This warning only shows up during a unity build.
#if defined(__GNUC__) && !defined(__llvm__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
/**
* Wraps around `IParamValueQueue` for serializing a queue containing changes to
@@ -102,9 +96,7 @@ class alignas(16) YaParamValueQueue : public Steinberg::Vst::IParamValueQueue {
*
* This contains pairs of `(sample_offset, value)`.
*/
boost::container::small_vector<std::pair<int32, Steinberg::Vst::ParamValue>,
16>
queue_;
llvm::SmallVector<std::pair<int32, Steinberg::Vst::ParamValue>, 16> queue_;
};
#pragma GCC diagnostic pop
@@ -16,8 +16,8 @@
#pragma once
#include <llvm/small-vector.h>
#include <pluginterfaces/vst/ivstparameterchanges.h>
#include <boost/container/small_vector.hpp>
#include "../../bitsery/traits/small-vector.h"
#include "base.h"
@@ -85,7 +85,7 @@ class YaParameterChanges : public Steinberg::Vst::IParameterChanges {
/**
* The parameter value changes queues.
*/
boost::container::small_vector<YaParamValueQueue, 16> queues_;
llvm::SmallVector<YaParamValueQueue, 16> queues_;
};
#pragma GCC diagnostic pop
+4 -4
View File
@@ -112,8 +112,8 @@ class YaProcessData {
struct Response {
// We store raw pointers instead of references so we can default
// initialize this object during deserialization
boost::container::small_vector_base<Steinberg::Vst::AudioBusBuffers>*
outputs = nullptr;
llvm::SmallVectorImpl<Steinberg::Vst::AudioBusBuffers>* outputs =
nullptr;
std::optional<YaParameterChanges>* output_parameter_changes = nullptr;
std::optional<YaEventList>* output_events = nullptr;
@@ -206,7 +206,7 @@ class YaProcessData {
* be set to point to our shared memory surface that holds the actual audio
* data.
*/
boost::container::small_vector<Steinberg::Vst::AudioBusBuffers, 8> inputs_;
llvm::SmallVector<Steinberg::Vst::AudioBusBuffers, 8> inputs_;
/**
* This contains metadata about the output buffers for every bus. During
@@ -214,7 +214,7 @@ class YaProcessData {
* be set to point to our shared memory surface that holds the actual audio
* data.
*/
boost::container::small_vector<Steinberg::Vst::AudioBusBuffers, 8> outputs_;
llvm::SmallVector<Steinberg::Vst::AudioBusBuffers, 8> outputs_;
/**
* Incoming parameter changes.