[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/926968 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Bill Budge <bbudge@chromium.org> Cr-Commit-Position: refs/heads/master@{#51401}
This commit is contained in:
parent
f64a87c45a
commit
f812038c06
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user