Ignore:
Timestamp:
Mar 15, 2011, 6:11:31 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) cpu load improvements based on profiling by gunzip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r12141 r12170  
    3939#include "utils.h"
    4040
    41 
    42 #define MAGIC_NUMBER 206745
    4341
    4442#ifdef WIN32
     
    140138    dbgmsg( io, "canRead" );
    141139
    142     assert( tr_isPeerIo( io ) );
    143     assert( tr_isSession( io->session ) );
    144140    tr_peerIoRef( io );
    145141
     
    161157            const unsigned int overhead = guessPacketOverhead( used );
    162158
    163             assert( tr_isPeerIo( io ) );
    164 
    165159            if( piece || (piece!=used) )
    166160            {
     
    198192    }
    199193
    200     assert( tr_isPeerIo( io ) );
    201194    tr_peerIoUnref( io );
    202 }
    203 
    204 tr_bool
    205 tr_isPeerIo( const tr_peerIo * io )
    206 {
    207     return ( io != NULL )
    208         && ( io->magicNumber == MAGIC_NUMBER )
    209         && ( io->refCount >= 0 )
    210         && ( tr_isBandwidth( &io->bandwidth ) )
    211         && ( tr_isAddress( &io->addr ) );
    212195}
    213196
     
    565548
    566549    io = tr_new0( tr_peerIo, 1 );
    567     io->magicNumber = MAGIC_NUMBER;
     550    io->magicNumber = PEER_IO_MAGIC_NUMBER;
    568551    io->refCount = 1;
    569552    io->crypto = tr_cryptoNew( torrentHash, isIncoming );
Note: See TracChangeset for help on using the changeset viewer.