mirror of
https://github.com/termux/termux-packages.git
synced 2025-05-10 13:55:33 +00:00
This fixes the following compiler error. rak/allocators.h:81:38: error: reference to unresolved using declaration 81 | return static_cast(std::aligned_alloc(LT_SMP_CACHE_BYTES, size)); | ^
19 lines
664 B
Diff
19 lines
664 B
Diff
# Revert https://github.com/rakshasa/libtorrent/commit/4d72cdde1a7b3e24c319bd937dfe6b21539a1ec1
|
|
|
|
--- a/rak/allocators.h
|
|
+++ b/rak/allocators.h
|
|
@@ -78,7 +78,13 @@
|
|
|
|
static pointer alloc_size(size_type size) {
|
|
// assert(size % LT_SMP_CACHE_BYTES == 0 && "Size must be a multiple of cacheline size");
|
|
+#if defined __ANDROID__ && __ANDROID_API__ >= 28
|
|
return static_cast<pointer>(std::aligned_alloc(LT_SMP_CACHE_BYTES, size));
|
|
+#else
|
|
+ pointer ptr = NULL;
|
|
+ [[maybe_unused]] int result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size);
|
|
+ return ptr;
|
|
+#endif
|
|
}
|
|
|
|
void construct (pointer p, const T& value) { new((void*)p)T(value); }
|