Ignore:
Timestamp:
Jan 2, 2009, 5:01:55 PM (13 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.h

    r7576 r7578  
    2727#endif
    2828
    29 #include "utils.h" /* tr_bitfield */
    30 
    3129#ifndef TR_TORRENT_H
    3230#define TR_TORRENT_H 1
     31
     32#include "completion.h" /* tr_completion */
     33#include "session.h" /* tr_globalLock(), tr_globalUnlock() */
     34#include "utils.h" /* tr_bitfield */
    3335
    3436struct tr_bandwidth;
     
    6466                                   tr_bool          has );
    6567
    66 extern inline void
    67             tr_torrentLock( const tr_torrent * session );
    68 
    69 extern inline void
    70             tr_torrentUnlock( const tr_torrent * session );
    71 
    7268tr_bool     tr_torrentIsSeed( const tr_torrent * session );
    7369
    7470void        tr_torrentChangeMyPort( tr_torrent * session );
    75 
    76 extern inline tr_bool
    77             tr_torrentExists( const tr_session * session,
    78                               const uint8_t    * hash );
    7971
    8072tr_torrent* tr_torrentFindFromId( tr_session * session,
     
    184176    uint32_t                   blockCountInLastPiece;
    185177
    186     struct tr_completion *     completion;
     178    struct tr_completion       completion;
    187179
    188180    struct tr_bitfield         checkedPieces;
     
    262254}
    263255
     256static inline void
     257tr_torrentLock( const tr_torrent * tor )
     258{
     259    tr_globalLock( tor->session );
     260}
     261
     262static inline void
     263tr_torrentUnlock( const tr_torrent * tor )
     264{
     265    tr_globalUnlock( tor->session );
     266}
     267
     268static inline tr_bool
     269tr_torrentExists( const tr_session * session, const uint8_t *   torrentHash )
     270{
     271    return tr_torrentFindFromHash( (tr_session*)session, torrentHash ) != NULL;
     272}
     273
     274
    264275#endif
Note: See TracChangeset for help on using the changeset viewer.