aboutsummaryrefslogtreecommitdiffstats
path: root/common/almalloc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-01-22 08:53:44 -0800
committerChris Robinson <[email protected]>2021-01-22 08:53:44 -0800
commitf576a353638236775ecb4f4e8ba93cb1716fbe2d (patch)
treea9c4be63a500465264136580d15e62af14ebab60 /common/almalloc.cpp
parent1dcc6361fe5c06dfd3ec30cfb9bce04e0c522805 (diff)
Don't bother checking for std::aligned_alloc
Diffstat (limited to 'common/almalloc.cpp')
-rw-r--r--common/almalloc.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/common/almalloc.cpp b/common/almalloc.cpp
index 4d7ff62c..ad1dc6be 100644
--- a/common/almalloc.cpp
+++ b/common/almalloc.cpp
@@ -18,10 +18,7 @@ void *al_malloc(size_t alignment, size_t size)
assert((alignment & (alignment-1)) == 0);
alignment = std::max(alignment, alignof(std::max_align_t));
-#if defined(HAVE_STD_ALIGNED_ALLOC)
- size = (size+(alignment-1))&~(alignment-1);
- return std::aligned_alloc(alignment, size);
-#elif defined(HAVE_POSIX_MEMALIGN)
+#if defined(HAVE_POSIX_MEMALIGN)
void *ret{};
if(posix_memalign(&ret, alignment, size) == 0)
return ret;
@@ -53,7 +50,7 @@ void *al_calloc(size_t alignment, size_t size)
void al_free(void *ptr) noexcept
{
-#if defined(HAVE_STD_ALIGNED_ALLOC) || defined(HAVE_POSIX_MEMALIGN)
+#if defined(HAVE_POSIX_MEMALIGN)
std::free(ptr);
#elif defined(HAVE__ALIGNED_MALLOC)
_aligned_free(ptr);