1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

replace boost::shared_array<T> to std::shared_ptr<T[]>

This commit is contained in:
Leonid Fedorov
2023-04-14 10:33:27 +00:00
parent a508b86091
commit c2d0fa24da
54 changed files with 190 additions and 200 deletions

View File

@ -31,13 +31,13 @@
#include <stdint.h>
#include <iostream>
#include <memory>
#define FIXEDALLOCATOR_DLLEXPORT
#include "fixedallocator.h"
#undef FIXEDALLOCATOR_DLLEXPORT
using namespace std;
using namespace boost;
namespace utils
{
@ -75,7 +75,7 @@ void FixedAllocator::setAllocSize(uint allocSize)
void FixedAllocator::newBlock()
{
shared_array<uint8_t> next;
std::shared_ptr<uint8_t[]> next;
capacityRemaining = elementCount * elementSize;

View File

@ -93,7 +93,7 @@ class FixedAllocator
private:
void newBlock();
std::vector<boost::shared_array<uint8_t> > mem;
std::vector<std::shared_ptr<uint8_t[]>> mem;
unsigned long capacityRemaining;
uint64_t elementCount;
unsigned long elementSize;

View File

@ -24,10 +24,11 @@
//#define NDEBUG
#include <cassert>
#include "poolallocator.h"
using namespace std;
using namespace boost;
namespace utils
{
@ -51,7 +52,7 @@ void PoolAllocator::deallocateAll()
void PoolAllocator::newBlock()
{
shared_array<uint8_t> next;
std::shared_ptr<uint8_t[]> next;
capacityRemaining = allocSize;

View File

@ -29,6 +29,7 @@
#include <stdint.h>
#include <vector>
#include <map>
#include <memory>
#include <atomic>
@ -89,7 +90,7 @@ class PoolAllocator
void* allocOOB(uint64_t size);
unsigned allocSize;
std::vector<boost::shared_array<uint8_t> > mem;
std::vector<std::shared_ptr<uint8_t[]>> mem;
bool tmpSpace;
unsigned capacityRemaining;
uint64_t memUsage;
@ -99,7 +100,7 @@ class PoolAllocator
struct OOBMemInfo
{
boost::shared_array<uint8_t> mem;
std::shared_ptr<uint8_t[]> mem;
uint64_t size;
};
typedef std::map<void*, OOBMemInfo> OutOfBandMap;