1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +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

@@ -31,9 +31,8 @@
#include <iterator>
using namespace std;
#include <boost/shared_array.hpp>
#include <numeric>
using namespace boost;
#include "bytestream.h"
using namespace messageqcpp;
@@ -97,7 +96,7 @@ uint64_t StringStore::storeString(const uint8_t* data, uint32_t len)
if ((len + 4) >= CHUNK_SIZE)
{
shared_array<uint8_t> newOne(new uint8_t[len + sizeof(MemChunk) + 4]);
std::shared_ptr<uint8_t[]> newOne(new uint8_t[len + sizeof(MemChunk) + 4]);
longStrings.push_back(newOne);
lastMC = (MemChunk*)longStrings.back().get();
lastMC->capacity = lastMC->currentSize = len + 4;
@@ -114,7 +113,7 @@ uint64_t StringStore::storeString(const uint8_t* data, uint32_t len)
// mem usage debugging
// if (lastMC)
// cout << "Memchunk efficiency = " << lastMC->currentSize << "/" << lastMC->capacity << endl;
shared_array<uint8_t> newOne(new uint8_t[CHUNK_SIZE + sizeof(MemChunk)]);
std::shared_ptr<uint8_t[]> newOne(new uint8_t[CHUNK_SIZE + sizeof(MemChunk)]);
mem.push_back(newOne);
lastMC = (MemChunk*)mem.back().get();
lastMC->currentSize = 0;
@@ -196,8 +195,8 @@ void StringStore::deserialize(ByteStream& bs)
void StringStore::clear()
{
vector<shared_array<uint8_t> > emptyv;
vector<shared_array<uint8_t> > emptyv2;
vector<std::shared_ptr<uint8_t[]> > emptyv;
vector<std::shared_ptr<uint8_t[]> > emptyv2;
mem.swap(emptyv);
longStrings.swap(emptyv2);
empty = true;
@@ -1338,9 +1337,9 @@ string RowGroup::toString(const std::vector<uint64_t>& used) const
return os.str();
}
boost::shared_array<int> makeMapping(const RowGroup& r1, const RowGroup& r2)
std::shared_ptr<int[]> makeMapping(const RowGroup& r1, const RowGroup& r2)
{
shared_array<int> ret(new int[r1.getColumnCount()]);
std::shared_ptr<int[]> ret(new int[r1.getColumnCount()]);
// bool reserved[r2.getColumnCount()];
bool* reserved = (bool*)alloca(r2.getColumnCount() * sizeof(bool));
uint32_t i, j;
@@ -1365,7 +1364,7 @@ boost::shared_array<int> makeMapping(const RowGroup& r1, const RowGroup& r2)
return ret;
}
void applyMapping(const boost::shared_array<int>& mapping, const Row& in, Row* out)
void applyMapping(const std::shared_ptr<int[]>& mapping, const Row& in, Row* out)
{
applyMapping(mapping.get(), in, out);
}
@@ -1406,7 +1405,7 @@ void applyMapping(const int* mapping, const Row& in, Row* out)
RowGroup& RowGroup::operator+=(const RowGroup& rhs)
{
boost::shared_array<bool> tmp;
std::shared_ptr<bool[]> tmp;
uint32_t i, j;
// not appendable if data is set
assert(!data);