fixed assert when built with disk stats

This commit is contained in:
Arvid Norberg 2009-08-05 19:02:51 +00:00
parent 5e2254df97
commit 7933132cd9
3 changed files with 4 additions and 3 deletions

View File

@ -172,7 +172,7 @@ namespace libtorrent
~disk_buffer_pool();
#endif
#ifdef TORRENT_DEBUG
#if defined TORRENT_DEBUG || defined TORRENT_DISK_STATS
bool is_disk_buffer(char* buffer
, boost::mutex::scoped_lock& l) const;
bool is_disk_buffer(char* buffer) const;

View File

@ -481,7 +481,8 @@ namespace libtorrent
void append_send_buffer(char* buffer, int size, Destructor const& destructor)
{
#if TORRENT_DISK_STATS
m_ses.m_disk_thread.rename_buffer(buffer, "queued send buffer");
if (m_ses.m_disk_thread.is_disk_buffer(buffer))
m_ses.m_disk_thread.rename_buffer(buffer, "queued send buffer");
#endif
m_send_buffer.append_buffer(buffer, size, size, destructor);
#ifdef TORRENT_STATS

View File

@ -78,7 +78,7 @@ namespace libtorrent
}
#endif
#ifdef TORRENT_DEBUG
#if defined TORRENT_DEBUG || defined TORRENT_DISK_STATS
bool disk_buffer_pool::is_disk_buffer(char* buffer
,boost::mutex::scoped_lock& l) const
{