(trunk libT) try not to cache file data read in during verification

This commit is contained in:
Charles Kerr 2009-12-16 06:34:17 +00:00
parent a942125d2f
commit 122d69d013
1 changed files with 6 additions and 0 deletions

View File

@ -99,6 +99,12 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag )
pieceBytesRead += numRead;
if( numRead == bytesThisPass )
SHA1_Update( &sha, buffer, numRead );
#ifdef HAVE_POSIX_FADVISE
posix_fadvise( fd, filePos, bytesThisPass, POSIX_FADV_DONTNEED );
#endif
#ifdef SYS_DARWIN
fcntl( fd, F_NOCACHE, 1 );
#endif
}
/* move our offsets */