Commit f812038c authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[Memory] Fix OS::Allocate on Windows / Cygwin.

- Changes assert to reflect that we might exceed the number of attempts
  to allocate a padded memory region while attempting to get an aligned
  allocation and return null instead.

Bug: chromium:813587
Change-Id: I0e225f50b7a64a2f2a72de15322525574445efbd
Reviewed-on: https://chromium-review.googlesource.com/926968Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51401}
parent f64a87c4
......@@ -139,7 +139,7 @@ void* OS::Allocate(void* address, size_t size, size_t alignment,
// base will be nullptr.
if (base != nullptr) break;
}
DCHECK_EQ(base, aligned_base);
DCHECK_IMPLIES(base, base == aligned_base);
return reinterpret_cast<void*>(base);
}
......
......@@ -829,7 +829,7 @@ void* OS::Allocate(void* address, size_t size, size_t alignment,
// base will be nullptr.
if (base != nullptr) break;
}
DCHECK_EQ(base, aligned_base);
DCHECK_IMPLIES(base, base == aligned_base);
return reinterpret_cast<void*>(base);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment