serve cache hits without a round-trip to the disk thread for improved seeding performance

This commit is contained in:
Arvid Norberg
2011-11-16 07:09:12 +00:00
parent 4efabcefff
commit 85ef2528c6
3 changed files with 58 additions and 25 deletions

View File

@@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/disk_buffer_pool.hpp"
#include "libtorrent/assert.hpp"
#include <algorithm>
#if TORRENT_USE_MLOCK && !defined TORRENT_WINDOWS
#include <sys/mman.h>
@@ -99,7 +100,7 @@ namespace libtorrent
#ifdef TORRENT_DISABLE_POOL_ALLOCATOR
char* ret = page_aligned_allocator::malloc(m_block_size);
#else
char* ret = (char*)m_pool.ordered_malloc();
char* ret = (char*)m_pool.malloc();
m_pool.set_next_size(m_settings.cache_buffer_chunk_size);
#endif
++m_in_use;