void ObjectPool::putReallocBuffer(ReallocBuffer * pRb) { std::auto_ptr<ReallocBuffer> rbPtr(pRb); pRb->resize(0); Lock lock(mRbPoolMutex); if (mRbPool.size() < mBufferCountLimit) { mRbPool.push_back(rbPtr.release()); } }
void ObjectPool::putReallocBuffer(ReallocBuffer * pRb) { std::auto_ptr<ReallocBuffer> rbPtr(pRb); std::size_t bufferSize = rbPtr->capacity(); pRb->resize(0); // Check buffer count limit and buffer size limit. Lock lock(mRbPoolMutex); if (mRbPool.size() < mBufferCountLimit && bufferSize <= mBufferSizeLimit) { mRbPool.push_back(rbPtr.release()); } }