diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-08-27 14:51:36 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-08-27 14:51:36 +0000 |
commit | d883c8007ea8b5ffad10d82a66b1bb262e109705 (patch) | |
tree | 4d13495edf31c92462ee60c1d553380cfc918c8b /lib/sanitizer_common/sanitizer_allocator.cc | |
parent | b10027729a3b809469f6b6ad40407ca453d6f54a (diff) | |
download | compiler-rt-d883c8007ea8b5ffad10d82a66b1bb262e109705.tar.gz |
[Sanitizer] align allocation sizes in low level allocator
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_allocator.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc index b08434ad6..45fcb230c 100644 --- a/lib/sanitizer_common/sanitizer_allocator.cc +++ b/lib/sanitizer_common/sanitizer_allocator.cc @@ -60,7 +60,8 @@ void *InternalAllocBlock(void *p) { static LowLevelAllocateCallback low_level_alloc_callback; void *LowLevelAllocator::Allocate(uptr size) { - CHECK((size & (size - 1)) == 0 && "size must be a power of two"); + // Align allocation size. + size = RoundUpTo(size, 8); if (allocated_end_ - allocated_current_ < (sptr)size) { uptr size_to_allocate = Max(size, kPageSize); allocated_current_ = |