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

feat(): propagated changes into SLTPoolAllocator and friends

This commit is contained in:
drrtuy
2025-01-10 18:53:49 +00:00
parent a6de8ec1ac
commit 90b4322470
18 changed files with 516 additions and 129 deletions

View File

@ -25,6 +25,7 @@
#include <memory>
#include <boost/shared_ptr.hpp>
#include "poolallocator.h"
#include "resourcemanager.h"
#undef min
#undef max
@ -61,6 +62,7 @@ class STLPoolAllocator
};
STLPoolAllocator() throw();
STLPoolAllocator(joblist::ResourceManager* rm);
STLPoolAllocator(const STLPoolAllocator&) throw();
STLPoolAllocator(uint32_t capacity) throw();
template <class U>
@ -94,6 +96,20 @@ STLPoolAllocator<T>::STLPoolAllocator() throw()
pa.reset(new PoolAllocator(DEFAULT_SIZE));
}
template <class T>
STLPoolAllocator<T>::STLPoolAllocator(joblist::ResourceManager* rm)
{
if (rm)
{
auto alloc = rm->getAllocator<PoolAllocatorBufType>();
pa.reset(new PoolAllocator(alloc));
}
else
{
pa.reset(new PoolAllocator(DEFAULT_SIZE));
}
}
template <class T>
STLPoolAllocator<T>::STLPoolAllocator(const STLPoolAllocator<T>& s) throw()
{