Ignore:
Timestamp:
Apr 4, 2011, 4:45:41 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) when reading piece data in from a socket, avoid two unnecessary calls to memcpy()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r12280 r12303  
    572572    session->tag = tr_strdup( tag );
    573573    session->magicNumber = SESSION_MAGIC_NUMBER;
    574     session->buffer = tr_valloc( SESSION_BUFFER_SIZE );
    575574    tr_bandwidthConstruct( &session->bandwidth, session, NULL );
    576575    tr_peerIdInit( session->peer_id );
     
    10101009***/
    10111010
    1012 void*
    1013 tr_sessionGetBuffer( tr_session * session )
    1014 {
    1015     assert( tr_isSession( session ) );
    1016     assert( !session->bufferInUse );
    1017     assert( tr_amInEventThread( session ) );
    1018 
    1019     session->bufferInUse = true;
    1020     return session->buffer;
    1021 }
    1022 
    1023 void
    1024 tr_sessionReleaseBuffer( tr_session * session )
    1025 {
    1026     assert( tr_isSession( session ) );
    1027     assert( session->bufferInUse );
    1028     assert( tr_amInEventThread( session ) );
    1029 
    1030     session->bufferInUse = false;
    1031 }
    1032 
    10331011void
    10341012tr_sessionLock( tr_session * session )
     
    18631841    }
    18641842    tr_free( session->torrentDoneScript );
    1865     tr_free( session->buffer );
    18661843    tr_free( session->tag );
    18671844    tr_free( session->configDir );
Note: See TracChangeset for help on using the changeset viewer.