Changeset 2144


Ignore:
Timestamp:
Jun 18, 2007, 1:28:15 AM (15 years ago)
Author:
charles
Message:

if at first you don't succeed, try try again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/libtransmission/makemeta.c

    r2143 r2144  
    9191}
    9292
    93 #define MiB 1048576ul
    94 #define GiB 1073741824ul
    9593
    9694static int
    9795bestPieceSize( uint64_t totalSize )
    9896{
     97    const int MiB = 1048576;
     98    const int GiB = totalSize / (uint64_t)1073741824;
     99
    99100    /* almost always best to have a piee size of 512 or 256 kb.
    100101       common practice seems to be to bump up to 1MB pieces at
    101102       at total size of around 8GiB or so */
    102103
    103     if (totalSize >= (8 * GiB) )
     104    if( GiB >= 8 )
    104105        return MiB;
    105106
    106     if (totalSize >= GiB )
     107    if( GiB >= 1 )
    107108        return MiB / 2;
    108109
Note: See TracChangeset for help on using the changeset viewer.