namespace folly {
namespace detail {
-#ifdef _WIN32
-void* aligned_malloc(size_t size, size_t align) { return nullptr; }
+#if defined(__ANDROID__) && (__ANDROID_API__ <= 15)
-void aligned_free(void* aligned_ptr) {}
-#elif defined(__ANDROID__) && (__ANDROID_API__ <= 15)
-
-void* aligned_malloc(size_t size, size_t align) { return memalign(align, size) }
+void* aligned_malloc(size_t size, size_t align) {
+ return memalign(align, size);
+}
void aligned_free(void* aligned_ptr) { free(aligned_ptr); }
ASSERT_LE(contents.size(), kPageSize);
const size_t kSuccess = 0;
char* pageAlignedBuf = (char*)aligned_malloc(2 * kPageSize, kPageSize);
+ if (pageAlignedBuf == nullptr) {
+ ASSERT_FALSE(true);
+ }
// Protect the page after the first full page-aligned region of the
// malloc'ed buffer
mprotect(pageAlignedBuf + kPageSize, kPageSize, PROT_NONE);