[Mlir-commits] [mlir] [mlir] Add guard for using posixmemalign <= Android API 28 (PR #194263)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon May 4 10:23:20 PDT 2026


================
@@ -152,7 +152,7 @@ extern "C" void *mlirAlloc(uint64_t size) { return malloc(size); }
 extern "C" void *mlirAlignedAlloc(uint64_t alignment, uint64_t size) {
 #ifdef _WIN32
   return _aligned_malloc(size, alignment);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || (defined(__ANDROID_API__) && __ANDROID_API__ <= 28)
   // aligned_alloc was added in MacOS 10.15. Fall back to posix_memalign to also
----------------
enh-google wrote:

maybe update the comment too?

https://github.com/llvm/llvm-project/pull/194263


More information about the Mlir-commits mailing list