From bc8df05940f980777fd2b121c971527197f5a248 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Wed, 1 Nov 2006 14:30:22 +0000 Subject: removing memory pool --- cpp/src/Ice/Buffer.cpp | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'cpp/src/Ice/Buffer.cpp') diff --git a/cpp/src/Ice/Buffer.cpp b/cpp/src/Ice/Buffer.cpp index 1273ea92aaa..783854e4cb8 100644 --- a/cpp/src/Ice/Buffer.cpp +++ b/cpp/src/Ice/Buffer.cpp @@ -9,7 +9,6 @@ #include #include -#include using namespace std; using namespace Ice; @@ -22,25 +21,17 @@ IceInternal::Buffer::swap(Buffer& other) std::swap(i, other.i); } -IceInternal::Buffer::Container::Container(IceInternal::MemoryPool* pool, size_type maxCapacity) : +IceInternal::Buffer::Container::Container(size_type maxCapacity) : _buf(0), _size(0), _capacity(0), - _maxCapacity(maxCapacity), - _pool(pool) + _maxCapacity(maxCapacity) { } IceInternal::Buffer::Container::~Container() { - if(_pool) - { - _pool->free(_buf); - } - else - { - ::free(_buf); - } + ::free(_buf); } void @@ -56,14 +47,7 @@ IceInternal::Buffer::Container::swap(Container& other) void IceInternal::Buffer::Container::clear() { - if(_pool) - { - _pool->free(_buf); - } - else - { - ::free(_buf); - } + free(_buf); _buf = 0; _size = 0; _capacity = 0; @@ -88,25 +72,11 @@ IceInternal::Buffer::Container::reserve(size_type n) if(_buf) { - if(_pool) - { - _buf = _pool->realloc(_buf, _capacity); - } - else - { - _buf = reinterpret_cast(::realloc(_buf, _capacity)); - } + _buf = reinterpret_cast(::realloc(_buf, _capacity)); } else { - if(_pool) - { - _buf = _pool->alloc(_capacity); - } - else - { - _buf = reinterpret_cast(::malloc(_capacity)); - } + _buf = reinterpret_cast(::malloc(_capacity)); } if(!_buf) -- cgit v1.2.3