Avoid copying of buffers in yg. No more ugly brakes.

This commit is contained in:
vng 2010-12-22 22:17:49 +02:00 committed by Alex Zolotarev
parent 3ad5560982
commit 9438ad581e

View file

@ -12,7 +12,7 @@ SharedBufferManager::shared_buffer_ptr_t SharedBufferManager::reserveSharedBuffe
{
threads::MutexGuard g(m_mutex);
shared_buffer_ptr_list_t l = m_sharedBuffers[s];
shared_buffer_ptr_list_t & l = m_sharedBuffers[s];
if (l.empty())
l.push_back(make_shared_ptr(new shared_buffer_t(s)));
@ -27,7 +27,7 @@ void SharedBufferManager::freeSharedBuffer(size_t s, shared_buffer_ptr_t buf)
{
threads::MutexGuard g(m_mutex);
shared_buffer_ptr_list_t l = m_sharedBuffers[s];
shared_buffer_ptr_list_t & l = m_sharedBuffers[s];
l.push_back(buf);
}