about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch
blob: a5c0b6720699bf3e484c39c3b26d1755e34ad7da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/hacl-star-raw/karamel/include/krml/internal/target.h b/hacl-star-raw/karamel/include/krml/internal/target.h
index 695873a..c0aed18 100644
--- a/hacl-star-raw/karamel/include/krml/internal/target.h
+++ b/hacl-star-raw/karamel/include/krml/internal/target.h
@@ -82,6 +82,9 @@
 #  endif
 #  if (defined(_MSC_VER) || (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)))
 #    define KRML_ALIGNED_MALLOC(X, Y) _aligned_malloc(Y, X)
+#  elif defined(__APPLE__)
+#    include <mm_malloc.h>
+#    define KRML_ALIGNED_MALLOC(X, Y) _mm_malloc(Y, X)
 #  else
 #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
 #  endif