Ignore:
Timestamp:
Jul 27, 2007, 11:07:26 PM (15 years ago)
Author:
charles
Message:

save a little bit of memory per-torrent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r2515 r2518  
    4040
    4141    /* a block is complete if and only if we have it */
    42     int * completeBlocks;
     42    uint16_t * completeBlocks;
    4343};
    4444
     
    5252    cp->blockDownloaders = tr_new( uint8_t, tor->blockCount );
    5353    cp->pieceBitfield    = tr_bitfieldNew( tor->info.pieceCount );
    54     cp->completeBlocks   = tr_new( int, tor->info.pieceCount );
     54    cp->completeBlocks   = tr_new( uint16_t, tor->info.pieceCount );
    5555
    5656    tr_cpReset( cp );
     
    7171{
    7272    tr_torrent_t * tor = cp->tor;
    73     int i;
    7473
    7574    tr_bitfieldClear( cp->blockBitfield );
    7675    memset( cp->blockDownloaders, 0, tor->blockCount );
    7776    tr_bitfieldClear( cp->pieceBitfield );
    78     for( i = 0; i < tor->info.pieceCount; ++i )
    79         cp->completeBlocks[i] = 0;
     77    memset( cp->completeBlocks, 0, sizeof(uint16_t) * tor->info.pieceCount );
    8078}
    8179
Note: See TracChangeset for help on using the changeset viewer.