disk receive buffer cleanup

This commit is contained in:
Arvid Norberg
2008-05-05 06:25:22 +00:00
parent 7388144ec7
commit d15573ecc2
6 changed files with 38 additions and 33 deletions

View File

@@ -49,6 +49,12 @@ namespace libtorrent
TORRENT_ASSERT(buf == 0 || m_iothread.is_disk_buffer(buf));
}
void disk_buffer_holder::reset(char* buf)
{
if (m_buf) m_iothread.free_buffer(m_buf);
m_buf = buf;
}
char* disk_buffer_holder::release()
{
char* ret = m_buf;