X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=libs%2Flibtorrent%2Fpatches%2F110-fix-no-posix_memalign.diff;h=e86dd0190115a985423d9d56d0a42bcd67859707;hp=582e57f6cd3e7630cb074d4689c0ec5b2294ec8d;hb=162603f403f67d9828cdbb082c3278f4e8cd837f;hpb=b4dc13f419a3b8cefbef86d339fb24b3394ca297 diff --git a/libs/libtorrent/patches/110-fix-no-posix_memalign.diff b/libs/libtorrent/patches/110-fix-no-posix_memalign.diff index 582e57f6cd..e86dd01901 100644 --- a/libs/libtorrent/patches/110-fix-no-posix_memalign.diff +++ b/libs/libtorrent/patches/110-fix-no-posix_memalign.diff @@ -1,8 +1,6 @@ -Index: libtorrent/rak/allocators.h -=================================================================== ---- libtorrent/rak/allocators.h (revision 1121) -+++ libtorrent/rak/allocators.h (working copy) -@@ -74,17 +74,13 @@ +--- a/rak/allocators.h ++++ b/rak/allocators.h +@@ -74,17 +74,13 @@ public: size_type max_size () const throw() { return std::numeric_limits::max() / sizeof(T); } pointer allocate(size_type num, const_void_pointer hint = 0) { return alloc_size(num*sizeof(T)); } @@ -11,19 +9,19 @@ Index: libtorrent/rak/allocators.h - static pointer alloc_size(size_type size) { - pointer ptr = NULL; - int __UNUSED result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size); +- +- return ptr; +- } + static pointer alloc_size(size_type size); + static void dealloc_size(pointer p, size_type size); -- return ptr; -- } -- void construct (pointer p, const T& value) { new((void*)p)T(value); } void destroy (pointer p) { p->~T(); } - void deallocate (pointer p, size_type num) { ::operator delete((void*)p); } }; -@@ -98,8 +94,38 @@ +@@ -98,6 +94,36 @@ bool operator!= (const cacheline_allocat return false; } @@ -46,8 +44,8 @@ Index: libtorrent/rak/allocators.h +#endif + + return ptr; - } - ++} ++ +template +inline void cacheline_allocator::dealloc_size(pointer p, size_type size) { +#if HAVE_POSIX_MEMALIGN @@ -57,8 +55,6 @@ Index: libtorrent/rak/allocators.h +#endif +} + -+} -+ - // - // Operator new with custom allocators: + } + //