1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Remove boost shared array [develop 23.02] (#2812)

* remove boost/shared_array include

* replace boost::shared_array<T> to std::shared_ptr<T[]>
This commit is contained in:
Leonid Fedorov
2023-04-17 20:56:09 +03:00
committed by GitHub
parent f1697c261e
commit 030144127e
65 changed files with 222 additions and 232 deletions

View File

@ -152,17 +152,17 @@ void ByteStream::growBuf(uint32_t toSize)
}
}
std::vector<boost::shared_array<uint8_t>>& ByteStream::getLongStrings()
std::vector<std::shared_ptr<uint8_t[]>>& ByteStream::getLongStrings()
{
return longStrings;
}
const std::vector<boost::shared_array<uint8_t>>& ByteStream::getLongStrings() const
const std::vector<std::shared_ptr<uint8_t[]>>& ByteStream::getLongStrings() const
{
return longStrings;
}
void ByteStream::setLongStrings(const std::vector<boost::shared_array<uint8_t>>& other)
void ByteStream::setLongStrings(const std::vector<std::shared_ptr<uint8_t[]>>& other)
{
longStrings = other;
}

View File

@ -26,7 +26,7 @@
#include <vector>
#include <set>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#include <boost/version.hpp>
#include <boost/uuid/uuid.hpp>
#include <stdint.h>
@ -435,9 +435,9 @@ class ByteStream : public Serializeable
3 * sizeof(uint32_t); // space for the BS magic & length & number of long strings.
// Methods to get and set `long strings`.
EXPORT std::vector<boost::shared_array<uint8_t>>& getLongStrings();
EXPORT const std::vector<boost::shared_array<uint8_t>>& getLongStrings() const;
EXPORT void setLongStrings(const std::vector<boost::shared_array<uint8_t>>& other);
EXPORT std::vector<std::shared_ptr<uint8_t[]>>& getLongStrings();
EXPORT const std::vector<std::shared_ptr<uint8_t[]>>& getLongStrings() const;
EXPORT void setLongStrings(const std::vector<std::shared_ptr<uint8_t[]>>& other);
friend class ::ByteStreamTestSuite;
@ -469,7 +469,7 @@ class ByteStream : public Serializeable
uint8_t* fCurOutPtr; // the point in fBuf where data is extracted from next
uint32_t fMaxLen; // how big fBuf is currently
// Stores `long strings`.
std::vector<boost::shared_array<uint8_t>> longStrings;
std::vector<std::shared_ptr<uint8_t[]>> longStrings;
};
template <int W, typename T = void>

View File

@ -73,7 +73,7 @@ using namespace std;
#include <boost/scoped_array.hpp>
using boost::scoped_array;
#include <boost/shared_array.hpp>
#define INETSTREAMSOCKET_DLLEXPORT
#include "inetstreamsocket.h"
@ -515,7 +515,7 @@ const SBS InetStreamSocket::read(const struct ::timespec* timeout, bool* isTimeO
return SBS(new ByteStream(0));
res->advanceInputPtr(msglen);
std::vector<boost::shared_array<uint8_t>> longStrings;
std::vector<std::shared_ptr<uint8_t[]>> longStrings;
try
{
for (uint32_t i = 0; i < longStringSize; ++i)
@ -527,7 +527,7 @@ const SBS InetStreamSocket::read(const struct ::timespec* timeout, bool* isTimeO
return SBS(new ByteStream(0));
// Allocate new memory for the `long string`.
boost::shared_array<uint8_t> longString(
std::shared_ptr<uint8_t[]> longString(
new uint8_t[sizeof(rowgroup::StringStore::MemChunk) + memChunk.currentSize]);
uint8_t* longStringData = longString.get();