]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #3399 "tr_ioTestPiece() can be faster" -- fixed
authorCharles Kerr <charles@transmissionbt.com>
Wed, 7 Jul 2010 16:31:07 +0000 (16:31 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 7 Jul 2010 16:31:07 +0000 (16:31 +0000)
libtransmission/inout.c

index a7acfb3b82f102a10ca2f86e47a3252e7d6e07cb..b2d8fcf715b41ea6c2b44c0007a905cfffcddd5a 100644 (file)
@@ -30,7 +30,6 @@
 #include "crypto.h"
 #include "fdlimit.h"
 #include "inout.h"
-#include "peer-common.h" /* MAX_BLOCK_SIZE */
 #include "platform.h"
 #include "stats.h"
 #include "torrent.h"
@@ -289,8 +288,8 @@ recalculateHash( tr_torrent       * tor,
     size_t   bytesLeft;
     uint32_t offset = 0;
     tr_bool  success = TRUE;
-    const size_t buflen = MAX_BLOCK_SIZE;
-    uint8_t * buffer = tr_new( uint8_t, buflen );
+    const size_t buflen = 1024 * 256; /* 256 KiB buffer */
+    void * buffer = tr_valloc( buflen );
     SHA_CTX  sha;
 
     assert( tor != NULL );