Changeset 12904


Ignore:
Timestamp:
Sep 21, 2011, 8:17:36 PM (12 years ago)
Author:
jordan
Message:

#4496 'freeze when having a huge torrent' -- remove redundant debug calls to countArray(). This is a second iteration of optimizations based on MechMK1's Shark report.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bitfield.c

    r12902 r12904  
    186186    const bool has_all = tr_bitfieldHasAll( b );
    187187
    188     assert( tr_bitfieldIsValid( b ) );
    189 
    190188    if( has_all )
    191189        bytes_needed = get_bytes_needed( MAX( nth, b->true_count ) + 1 );
     
    195193    if( b->alloc_count < bytes_needed )
    196194    {
    197 #ifndef NDEBUG
    198         const size_t old_count = countArray( b );
    199 #endif
    200195        b->bits = tr_renew( uint8_t, b->bits, bytes_needed );
    201196        memset( b->bits + b->alloc_count, 0, bytes_needed - b->alloc_count );
    202197        b->alloc_count = bytes_needed;
    203         assert( old_count == countArray( b ) );
    204198
    205199        if( has_all )
Note: See TracChangeset for help on using the changeset viewer.