merged FreeBSD fix from RC_0_16

This commit is contained in:
Arvid Norberg 2012-04-15 00:48:44 +00:00
parent dafcf2c5ca
commit ba4c77e7e5
2 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,5 @@
* fixed FreeBSD build
* fixed web seed performance issue whith pieces > 1 MiB
* fixed unchoke logic when using web seeds
* fixed compatibility with older versions of boost (down to boost 1.40)

View File

@ -1452,7 +1452,14 @@ namespace libtorrent
// sizing the disk cache size when it's set to
// automatic.
#ifdef TORRENT_BSD
#ifdef HW_MEMSIZE
int mib[2] = { CTL_HW, HW_MEMSIZE };
#else
// not entirely sure this sysctl supports 64
// bit return values, but it's probably better
// than not building
int mib[2] = { CTL_HW, HW_PHYSMEM };
#endif
size_t len = sizeof(m_physical_ram);
if (sysctl(mib, 2, &m_physical_ram, &len, NULL, 0) != 0)
m_physical_ram = 0;