Commit ca5cc4e4 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Commit Bot

Fix OutOfMemoryDeathTest.AlignedAlloc when using USING_PARTITION_ALLOC_AS_MALLOC

This fixes a bug of https://chromium-review.googlesource.com/c/chromium/src/+/2418631

Bug: 998048
Change-Id: Iffb7b291d3e0689781e5dea7d011e74b68f186bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437668
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Reviewed-by: default avatarBartek Nowierski <bartekn@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812640}
parent 1a09bd64
...@@ -1111,8 +1111,10 @@ ALWAYS_INLINE void* PartitionRoot<thread_safe>::AlignedAllocFlags( ...@@ -1111,8 +1111,10 @@ ALWAYS_INLINE void* PartitionRoot<thread_safe>::AlignedAllocFlags(
<< (sizeof(size_t) * 8 - base::bits::CountLeadingZeroBits(size - 1)); << (sizeof(size_t) * 8 - base::bits::CountLeadingZeroBits(size - 1));
} }
// TODO(tasak): Clean up the following condition and PA_CHECK(requested_size
// >= size).
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) #if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
if (requested_size > MaxDirectMapped()) { if (size > MaxDirectMapped()) {
if (flags & PartitionAllocReturnNull) if (flags & PartitionAllocReturnNull)
return nullptr; return nullptr;
// OutOfMemoryDeathTest.AlignedAlloc requires base::OnNoMemoryInternal // OutOfMemoryDeathTest.AlignedAlloc requires base::OnNoMemoryInternal
......
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