Skip to content

Commit 1e56a0b

Browse files
authored
Merge pull request mariadb-corporation#2811 from mariadb-corporation/remove-boost-shared-array
Remove boost shared array
2 parents 7bed087 + c2d0fa2 commit 1e56a0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+222
-232
lines changed

dbcon/execplan/sessionmanager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const TxnID SessionManager::getTxnID(const SID session)
119119
return ret;
120120
}
121121

122-
boost::shared_array<SIDTIDEntry> SessionManager::SIDTIDMap(int& len)
122+
std::shared_ptr<SIDTIDEntry[]> SessionManager::SIDTIDMap(int& len)
123123
{
124124
// is this cast valid?
125125
return dbrm.SIDTIDMap(len);
@@ -150,7 +150,7 @@ bool SessionManager::checkActiveTransaction(const SID sessionId, bool& bIsDbrmUp
150150
bIsDbrmUp = true;
151151
int arrayLenth = 0;
152152
bool ret = false;
153-
boost::shared_array<SIDTIDEntry> sIDTIDMap;
153+
std::shared_ptr<SIDTIDEntry[]> sIDTIDMap;
154154

155155
sIDTIDMap = SIDTIDMap(arrayLenth);
156156

@@ -178,7 +178,7 @@ bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp)
178178
bIsDbrmUp = true;
179179
int arrayLenth = 0;
180180
bool ret = false;
181-
boost::shared_array<SIDTIDEntry> sIDTIDMap;
181+
std::shared_ptr<SIDTIDEntry[]> sIDTIDMap;
182182

183183
sIDTIDMap = SIDTIDMap(arrayLenth);
184184

dbcon/execplan/sessionmanager.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include "calpontsystemcatalog.h"
3030
#include "brm.h"
31-
#include "boost/shared_array.hpp"
3231

3332
namespace execplan
3433
{
@@ -174,7 +173,7 @@ class SessionManager
174173
* @return A pointer to the array. Note: The caller is responsible for
175174
* deallocating it. Use delete[].
176175
*/
177-
boost::shared_array<BRM::SIDTIDEntry> SIDTIDMap(int& len);
176+
std::shared_ptr<BRM::SIDTIDEntry[]> SIDTIDMap(int& len);
178177

179178
/** @brief Returns a unique uint32_t. It eventually wraps around, but who cares.
180179
*

dbcon/joblist/batchprimitiveprocessor-jl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ void BatchPrimitiveProcessorJL::getRowGroupData(ByteStream& in, vector<RGData>*
873873

874874
if (!pmSendsFinalResult() || pmSendsMatchesAnyway)
875875
{
876-
boost::shared_array<vector<uint32_t> > joinResults;
876+
std::shared_ptr<vector<uint32_t>[]> joinResults;
877877
uint32_t i, j;
878878

879879
if (pmSendsMatchesAnyway)
@@ -920,7 +920,6 @@ void BatchPrimitiveProcessorJL::getRowGroupData(ByteStream& in, vector<RGData>*
920920
idbassert(in.length() == 0);
921921
}
922922

923-
// boost::shared_array<uint8_t>
924923
RGData BatchPrimitiveProcessorJL::getErrorRowGroupData(uint16_t error) const
925924
{
926925
RGData ret;

dbcon/joblist/batchprimitiveprocessor-jl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ class BatchPrimitiveProcessorJL
184184
return status;
185185
}
186186
void runErrorBPP(messageqcpp::ByteStream&);
187-
// uint32_t getErrorTableBand(uint16_t error, messageqcpp::ByteStream *out);
188-
// boost::shared_array<uint8_t> getErrorRowGroupData(uint16_t error) const;
187+
189188
rowgroup::RGData getErrorRowGroupData(uint16_t error) const;
190189

191190
// @bug 1098

dbcon/joblist/crossenginestep.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
using namespace std;
2828

2929
#include <boost/shared_ptr.hpp>
30-
#include <boost/shared_array.hpp>
30+
3131
#include <boost/uuid/uuid_io.hpp>
3232
using namespace boost;
3333

@@ -408,7 +408,6 @@ void CrossEngineStep::execute()
408408
int num_fields = mysql->getFieldCount();
409409

410410
char** rowIn; // input
411-
// shared_array<uint8_t> rgDataDelivered; // output
412411
RGData rgDataDelivered;
413412
fRowGroupAdded.initRow(&fRowDelivered);
414413
// use getDataSize() i/o getMaxDataSize() to make sure there are 8192 rows.
@@ -438,7 +437,7 @@ void CrossEngineStep::execute()
438437

439438
else if (doFE1 && !doFE3) // FE in WHERE clause only
440439
{
441-
shared_array<uint8_t> rgDataFe1; // functions in where clause
440+
std::shared_ptr<uint8_t[]> rgDataFe1; // functions in where clause
442441
Row rowFe1; // row for fe evaluation
443442
fRowGroupFe1.initRow(&rowFe1, true);
444443
rgDataFe1.reset(new uint8_t[rowFe1.getSize()]);
@@ -489,7 +488,7 @@ void CrossEngineStep::execute()
489488

490489
else if (!doFE1 && doFE3) // FE in SELECT clause only
491490
{
492-
shared_array<uint8_t> rgDataFe3; // functions in select clause
491+
std::shared_ptr<uint8_t[]> rgDataFe3; // functions in select clause
493492
Row rowFe3; // row for fe evaluation
494493
fRowGroupOut.initRow(&rowFe3, true);
495494
rgDataFe3.reset(new uint8_t[rowFe3.getSize()]);
@@ -510,13 +509,13 @@ void CrossEngineStep::execute()
510509

511510
else // FE in SELECT clause, FE join and WHERE clause
512511
{
513-
shared_array<uint8_t> rgDataFe1; // functions in where clause
512+
std::shared_ptr<uint8_t[]> rgDataFe1; // functions in where clause
514513
Row rowFe1; // row for fe1 evaluation
515514
fRowGroupFe1.initRow(&rowFe1, true);
516515
rgDataFe1.reset(new uint8_t[rowFe1.getSize()]);
517516
rowFe1.setData(rowgroup::Row::Pointer(rgDataFe1.get()));
518517

519-
shared_array<uint8_t> rgDataFe3; // functions in select clause
518+
std::shared_ptr<uint8_t[]> rgDataFe3; // functions in select clause
520519
Row rowFe3; // row for fe3 evaluation
521520
fRowGroupOut.initRow(&rowFe3, true);
522521
rgDataFe3.reset(new uint8_t[rowFe3.getSize()]);
@@ -708,7 +707,6 @@ const RowGroup& CrossEngineStep::getDeliveredRowGroup() const
708707

709708
uint32_t CrossEngineStep::nextBand(messageqcpp::ByteStream& bs)
710709
{
711-
// shared_array<uint8_t> rgDataOut;
712710
RGData rgDataOut;
713711
bool more = false;
714712
uint32_t rowCount = 0;

dbcon/joblist/crossenginestep.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
178178
virtual std::string makeQuery();
179179
virtual void setField(int, const char*, unsigned long, MYSQL_FIELD*, rowgroup::Row&);
180180
inline void addRow(rowgroup::RGData&);
181-
// inline void addRow(boost::shared_array<uint8_t>&);
181+
182182
template <typename T>
183183
T convertValueNum(const char*, const execplan::CalpontSystemCatalog::ColType&);
184184
virtual void formatMiniStats();
@@ -238,8 +238,8 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
238238
std::map<uint32_t, uint32_t> fColumnMap; // projected key position (k->p)
239239
uint64_t fColumnCount;
240240
boost::scoped_array<int> fFe1Column;
241-
boost::shared_array<int> fFeMapping1;
242-
boost::shared_array<int> fFeMapping3;
241+
std::shared_ptr<int[]> fFeMapping1;
242+
std::shared_ptr<int[]> fFeMapping3;
243243
rowgroup::RowGroup fRowGroupFe1;
244244
rowgroup::RowGroup fRowGroupFe3;
245245

dbcon/joblist/diskjoinstep.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ void DiskJoinStep::joinFcn()
359359
Row l_largeRow;
360360
Row l_joinFERow, l_outputRow, baseRow;
361361
vector<vector<Row::Pointer> > joinMatches;
362-
boost::shared_array<Row> smallRowTemplates(new Row[1]);
362+
std::shared_ptr<Row[]> smallRowTemplates(new Row[1]);
363363
vector<std::shared_ptr<TupleJoiner>> joiners;
364-
boost::shared_array<boost::shared_array<int> > colMappings, fergMappings;
364+
std::shared_ptr<std::shared_ptr<int[]>[]> colMappings, fergMappings;
365365
boost::scoped_array<boost::scoped_array<uint8_t> > smallNullMem;
366366
boost::scoped_array<uint8_t> joinFEMem;
367367
Row smallNullRow;
@@ -386,13 +386,13 @@ void DiskJoinStep::joinFcn()
386386
smallRG.initRow(&smallRowTemplates[0]);
387387
joiners.resize(1);
388388

389-
colMappings.reset(new boost::shared_array<int>[2]);
389+
colMappings.reset(new std::shared_ptr<int[]>[2]);
390390
colMappings[0] = SOMapping;
391391
colMappings[1] = LOMapping;
392392

393393
if (fe)
394394
{
395-
fergMappings.reset(new boost::shared_array<int>[2]);
395+
fergMappings.reset(new std::shared_ptr<int[]>[2]);
396396
fergMappings[0] = SjoinFEMapping;
397397
fergMappings[1] = LjoinFEMapping;
398398
}

dbcon/joblist/diskjoinstep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DiskJoinStep : public JobStep
5050
boost::shared_ptr<RowGroupDL> largeDL, outputDL;
5151
RowGroupDL* smallDL;
5252

53-
boost::shared_array<int> LOMapping, SOMapping, SjoinFEMapping, LjoinFEMapping;
53+
std::shared_ptr<int[]> LOMapping, SOMapping, SjoinFEMapping, LjoinFEMapping;
5454
TupleHashJoinStep* thjs;
5555
boost::shared_ptr<funcexp::FuncExpWrapper> fe;
5656
bool typeless;

dbcon/joblist/elementtype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <utility>
2727
#include <string>
2828
#include <stdexcept>
29-
#include <boost/shared_array.hpp>
29+
3030
#include <stdint.h>
3131
#include <rowgroup.h>
3232

dbcon/joblist/expressionstep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
using namespace std;
2525

2626
#include <boost/shared_ptr.hpp>
27-
#include <boost/shared_array.hpp>
27+
2828
using namespace boost;
2929

3030
#include "messagequeue.h"

0 commit comments

Comments
 (0)