summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-08-27 14:51:36 +0000
committerAlexey Samsonov <samsonov@google.com>2012-08-27 14:51:36 +0000
commitd1d1a814b785cc28c3dac566423604ab7d66f54c (patch)
tree9535488253769d0d980cdacd105974be3edf7177 /compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
parentf72f08affc71970711b590eb6579be49e5aba25e (diff)
downloadbcm5719-llvm-d1d1a814b785cc28c3dac566423604ab7d66f54c.tar.gz
bcm5719-llvm-d1d1a814b785cc28c3dac566423604ab7d66f54c.zip
[Sanitizer] align allocation sizes in low level allocator
llvm-svn: 162676
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
index b08434ad668..45fcb230c79 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
+++ b/compiler-rt/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_ =
OpenPOWER on IntegriCloud