forked from premiere/premiere-libtorrent
added compile time option for mlock support
This commit is contained in:
parent
982cf7f7f7
commit
91ba36a396
|
@ -86,6 +86,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#define TORRENT_USE_IPV6 1
|
#define TORRENT_USE_IPV6 1
|
||||||
|
|
||||||
|
#define TORRENT_USE_MLOCK 1
|
||||||
|
|
||||||
// should wpath or path be used?
|
// should wpath or path be used?
|
||||||
#if defined UNICODE && !defined BOOST_FILESYSTEM_NARROW_ONLY \
|
#if defined UNICODE && !defined BOOST_FILESYSTEM_NARROW_ONLY \
|
||||||
&& BOOST_VERSION >= 103400 && !defined __APPLE__
|
&& BOOST_VERSION >= 103400 && !defined __APPLE__
|
||||||
|
|
|
@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/time.hpp"
|
#include "libtorrent/time.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined TORRENT_DISABLE_MLOCK && !defined TORRENT_WINDOWS
|
#if TORRENT_USE_MLOCK && !defined TORRENT_WINDOWS
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ namespace libtorrent
|
||||||
#else
|
#else
|
||||||
char* ret = (char*)m_pool.ordered_malloc();
|
char* ret = (char*)m_pool.ordered_malloc();
|
||||||
#endif
|
#endif
|
||||||
#ifndef TORRENT_DISABLE_MLOCK
|
#if TORRENT_USE_MLOCK
|
||||||
if (m_settings.lock_disk_cache)
|
if (m_settings.lock_disk_cache)
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
@ -116,7 +116,7 @@ namespace libtorrent
|
||||||
m_log << log_time() << " " << category << ": " << m_categories[category] << "\n";
|
m_log << log_time() << " " << category << ": " << m_categories[category] << "\n";
|
||||||
m_buf_to_category.erase(buf);
|
m_buf_to_category.erase(buf);
|
||||||
#endif
|
#endif
|
||||||
#ifndef TORRENT_DISABLE_MLOCK
|
#if TORRENT_USE_MLOCK
|
||||||
if (m_settings.lock_disk_cache)
|
if (m_settings.lock_disk_cache)
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
@ -141,7 +141,7 @@ namespace libtorrent
|
||||||
#else
|
#else
|
||||||
char* ret = (char*)m_pool.ordered_malloc(num_blocks);
|
char* ret = (char*)m_pool.ordered_malloc(num_blocks);
|
||||||
#endif
|
#endif
|
||||||
#ifndef TORRENT_DISABLE_MLOCK
|
#if TORRENT_USE_MLOCK
|
||||||
if (m_settings.lock_disk_cache)
|
if (m_settings.lock_disk_cache)
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
@ -174,7 +174,7 @@ namespace libtorrent
|
||||||
m_log << log_time() << " " << category << ": " << m_categories[category] << "\n";
|
m_log << log_time() << " " << category << ": " << m_categories[category] << "\n";
|
||||||
m_buf_to_category.erase(buf);
|
m_buf_to_category.erase(buf);
|
||||||
#endif
|
#endif
|
||||||
#ifndef TORRENT_DISABLE_MLOCK
|
#if TORRENT_USE_MLOCK
|
||||||
if (m_settings.lock_disk_cache)
|
if (m_settings.lock_disk_cache)
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
|
Loading…
Reference in New Issue