made some moer invariant checks count as expensive

This commit is contained in:
Arvid Norberg 2008-10-10 07:08:46 +00:00
parent b417a03877
commit 62e365225b
2 changed files with 6 additions and 0 deletions

View File

@ -3063,7 +3063,9 @@ namespace libtorrent
void peer_connection::fill_send_buffer() void peer_connection::fill_send_buffer()
{ {
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
INVARIANT_CHECK; INVARIANT_CHECK;
#endif
boost::shared_ptr<torrent> t = m_torrent.lock(); boost::shared_ptr<torrent> t = m_torrent.lock();
if (!t) return; if (!t) return;
@ -4022,7 +4024,9 @@ namespace libtorrent
void peer_connection::keep_alive() void peer_connection::keep_alive()
{ {
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
INVARIANT_CHECK; INVARIANT_CHECK;
#endif
time_duration d; time_duration d;
d = time_now() - m_last_sent; d = time_now() - m_last_sent;

View File

@ -2177,7 +2177,9 @@ namespace libtorrent
// a peer disconnects. The piece might be in any state // a peer disconnects. The piece might be in any state
void piece_picker::abort_download(piece_block block) void piece_picker::abort_download(piece_block block)
{ {
#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS
TORRENT_PIECE_PICKER_INVARIANT_CHECK; TORRENT_PIECE_PICKER_INVARIANT_CHECK;
#endif
TORRENT_ASSERT(block.piece_index >= 0); TORRENT_ASSERT(block.piece_index >= 0);
TORRENT_ASSERT(block.block_index >= 0); TORRENT_ASSERT(block.block_index >= 0);