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/tracker.c

    r7476 r7528  
    9393    tr_session *      session;
    9494
    95     tr_publisher_t *  publisher;
     95    tr_publisher      publisher;
    9696
    9797    /* torrent hash string */
     
    200200        event.messageType = type;
    201201        event.text = msg;
    202         tr_publisherPublish( t->publisher, t, &event );
     202        tr_publisherPublish( &t->publisher, t, &event );
    203203    }
    204204}
     
    239239    event.compactLen = compactLen;
    240240    if( compactLen )
    241         tr_publisherPublish( t->publisher, t, &event );
     241        tr_publisherPublish( &t->publisher, t, &event );
    242242}
    243243
     
    10491049
    10501050    t = tr_new0( tr_tracker, 1 );
    1051     t->publisher = tr_publisherNew( );
     1051    t->publisher                = TR_PUBLISHER_INIT;
    10521052    t->session                  = torrent->session;
    10531053    t->scrapeIntervalSec        = DEFAULT_SCRAPE_INTERVAL_SEC;
     
    10821082    tr_tracker * t = vt;
    10831083
    1084     tr_publisherFree( &t->publisher );
     1084    tr_publisherDestruct( &t->publisher );
    10851085    tr_free( t->name );
    10861086    tr_free( t->trackerID );
     
    11061106                     void *           user_data )
    11071107{
    1108     return tr_publisherSubscribe( t->publisher, func, user_data );
     1108    return tr_publisherSubscribe( &t->publisher, func, user_data );
    11091109}
    11101110
     
    11141114{
    11151115    if( t )
    1116         tr_publisherUnsubscribe( t->publisher, tag );
     1116        tr_publisherUnsubscribe( &t->publisher, tag );
    11171117}
    11181118
Note: See TracChangeset for help on using the changeset viewer.