diff --git a/configure.ac b/configure.ac index b898eaac3..bd081acb6 100644 --- a/configure.ac +++ b/configure.ac @@ -87,8 +87,6 @@ LIBS="$PTHREAD_LIBS $ZLIB_LIBS $LIBS" TORRENT_ARG_OPENSSL TORRENT_ARG_CYRUS_RC4 -AC_CHECK_FUNCS(posix_memalign) - TORRENT_CHECK_MADVISE TORRENT_CHECK_CACHELINE TORRENT_CHECK_POPCOUNT diff --git a/rak/allocators.h b/rak/allocators.h index 0398aa7ee..73d77a86a 100644 --- a/rak/allocators.h +++ b/rak/allocators.h @@ -76,10 +76,7 @@ class cacheline_allocator { pointer allocate(size_type num, const_void_pointer hint = 0) { return alloc_size(num*sizeof(T)); } static pointer alloc_size(size_type size) { - pointer ptr = NULL; - [[maybe_unused]] int result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size); - - return ptr; + return static_cast(std::aligned_alloc(LT_SMP_CACHE_BYTES, size)); } void construct (pointer p, const T& value) { new((void*)p)T(value); }