Always serialize in little-endian and skip checks

These checks are not necessary since we can trust ourselves to not try
to cause any buffer overflows.
This commit is contained in:
Robbert van der Helm
2021-05-16 13:15:14 +02:00
parent 4b5cb3e205
commit 448243050a
2 changed files with 20 additions and 3 deletions
+2
View File
@@ -26,6 +26,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
by getting rid of all memory allocations during audio processing.
- Changed the way mutual recursion in VST3 plugins on the plugin side works to
counter any potential GUI related timing issues with VST3 plugins.
- The deserialization part of yabridge's communication is now slightly faster by
skipping some unnecessary checks.
### Fixed
+18 -3
View File
@@ -35,11 +35,26 @@
#include "../logging/common.h"
#include "../utils.h"
template <typename B>
using OutputAdapter = bitsery::OutputBufferAdapter<B>;
namespace bitsery {
struct LittleEndianConfig {
// In case we ever want to bridge from some big-endian architecture to
// x86_64 Windows, then we should make sure we always encode data using the
// same endianness
static constexpr EndiannessType Endianness = EndiannessType::LittleEndian;
// Since we provide the data on both sides, we can safely disable these
// checks
static constexpr bool CheckDataErrors = false;
static constexpr bool CheckAdapterErrors = false;
};
} // namespace bitsery
template <typename B>
using InputAdapter = bitsery::InputBufferAdapter<B>;
using OutputAdapter =
bitsery::OutputBufferAdapter<B, bitsery::LittleEndianConfig>;
template <typename B>
using InputAdapter =
bitsery::InputBufferAdapter<B, bitsery::LittleEndianConfig>;
/**
* Serialize an object using bitsery and write it to a socket. This will write