From 8a9f0049821803051201edebc6d9a0f0639756c3 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 19 Dec 2014 12:04:06 -0800 Subject: [PATCH] ART: Do not compile swap file functionality on Mac Bug: 18596910 Change-Id: Ic06429f41840ce318cfaa837efecc69c2076440e --- compiler/utils/swap_space.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/utils/swap_space.cc b/compiler/utils/swap_space.cc index 19338c06a..fc514354e 100644 --- a/compiler/utils/swap_space.cc +++ b/compiler/utils/swap_space.cc @@ -131,6 +131,7 @@ void* SwapSpace::Alloc(size_t size) { } SpaceChunk SwapSpace::NewFileChunk(size_t min_size) { +#if !defined(__APPLE__) size_t next_part = std::max(RoundUp(min_size, kPageSize), RoundUp(kMininumMapSize, kPageSize)); int result = TEMP_FAILURE_RETRY(ftruncate64(fd_, size_ + next_part)); if (result != 0) { @@ -151,6 +152,11 @@ SpaceChunk SwapSpace::NewFileChunk(size_t min_size) { SpaceChunk new_chunk = {ptr, next_part}; maps_.push_back(new_chunk); return new_chunk; +#else + UNUSED(kMininumMapSize); + LOG(FATAL) << "No swap file support on the Mac."; + return {nullptr, 0U}; // NOLINT [readability/braces] [4] +#endif } // TODO: Full coalescing. -- 2.11.0