1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -14,12 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#pragma once
/* This class defines a pool of bytestreams to improve BS reuse, reducing
the need to use the dynamic allocator. It allocates as many BS's as needed,
and automatically disposes of buffers that are 'large' to reduce mem usage.
and automatically disposes of buffers that are 'large' to reduce mem usage.
Initially, 'large' is defined as 1MB.
*/
@ -29,24 +29,23 @@ Initially, 'large' is defined as 1MB.
namespace messageqcpp
{
class ByteStreamPool
{
public:
ByteStreamPool();
ByteStreamPool(uint largeBufferSize); // BS's above largeBufferSize get deallocated on return to the pool
ByteStreamPool(uint largeBufferSize, uint freeBufferLimit); // freeBufferLimit is the max # of BSs to reserve
virtual ~ByteStreamPool();
ByteStream * getByteStream();
void returnByteStream(ByteStream *);
private:
std::deque<ByteStream *> freeByteStreams;
boost::mutex mutex;
uint maxBufferSize;
uint maxFreeBuffers;
public:
ByteStreamPool();
ByteStreamPool(uint largeBufferSize); // BS's above largeBufferSize get deallocated on return to the pool
ByteStreamPool(uint largeBufferSize,
uint freeBufferLimit); // freeBufferLimit is the max # of BSs to reserve
virtual ~ByteStreamPool();
ByteStream* getByteStream();
void returnByteStream(ByteStream*);
private:
std::deque<ByteStream*> freeByteStreams;
boost::mutex mutex;
uint maxBufferSize;
uint maxFreeBuffers;
};
}
} // namespace messageqcpp