Ignore:
Timestamp:
Dec 29, 2008, 6:10:07 PM (12 years ago)
Author:
charles
Message:

(trunk libT) avoid some unnecessary memory fragmentation... for composited objects that have a tr_publisher, contain the it directly rather than a pointer to one allocated elsewhere on the heap.

File:
1 edited

Legend:

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

    r7476 r7528  
    297297    tr_torrent *           torrent;
    298298
    299     tr_publisher_t *       publisher;
     299    tr_publisher           publisher;
    300300
    301301    struct evbuffer *      outMessages; /* all the non-piece messages */
     
    531531    assert( msgs->peer->msgs == msgs );
    532532
    533     tr_publisherPublish( msgs->publisher, msgs->peer, e );
     533    tr_publisherPublish( &msgs->publisher, msgs->peer, e );
    534534}
    535535
     
    22102210
    22112211    m = tr_new0( tr_peermsgs, 1 );
    2212     m->publisher = tr_publisherNew( );
     2212    m->publisher = TR_PUBLISHER_INIT;
    22132213    m->peer = peer;
    22142214    m->session = torrent->session;
     
    22302230    peer->msgs = m;
    22312231
    2232     *setme = tr_publisherSubscribe( m->publisher, func, userData );
     2232    *setme = tr_publisherSubscribe( &m->publisher, func, userData );
    22332233
    22342234    if( tr_peerIoSupportsLTEP( peer->io ) )
     
    22492249    {
    22502250        tr_timerFree( &msgs->pexTimer );
    2251         tr_publisherFree( &msgs->publisher );
     2251        tr_publisherDestruct( &msgs->publisher );
    22522252        reqListClear( &msgs->clientWillAskFor );
    22532253        reqListClear( &msgs->clientAskedFor );
     
    22682268                        tr_publisher_tag tag )
    22692269{
    2270     tr_publisherUnsubscribe( peer->publisher, tag );
    2271 }
    2272 
     2270    tr_publisherUnsubscribe( &peer->publisher, tag );
     2271}
     2272
Note: See TracChangeset for help on using the changeset viewer.