Permalink
Browse files

Merge branch 'fix-aesni-aligned-malloc'

  • Loading branch information...
2 parents c007f6e + 6e16b17 commit 2d1aecd731f91f7367ef2a4069d305e2a1b488c0 @dlitz dlitz committed Feb 22, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/AESNI.c
View
6 src/AESNI.c
@@ -63,7 +63,11 @@ static void* aligned_malloc_wrapper(size_t alignment, size_t size)
}
# define aligned_free_wrapper free
#elif defined(HAVE__ALIGNED_MALLOC) /* _aligned_malloc is available on Windows */
-# define aligned_malloc_wrapper _aligned_malloc
+static void* aligned_malloc_wrapper(size_t alignment, size_t size)
+{
+ /* NB: _aligned_malloc takes its args in the opposite order from aligned_alloc */
+ return _aligned_malloc(size, alignment);
+}
# define aligned_free_wrapper _aligned_free
#else
# error "No function to allocate/free aligned memory is available."

0 comments on commit 2d1aecd

Please sign in to comment.