aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/sanitizer_common/sanitizer_allocator.cpp
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-06-01 21:15:18 +0200
committerMartin Liska <mliska@suse.cz>2020-06-02 08:02:07 +0200
commit3c6331c29f1376ed220246e7dead94bc527a9aa9 (patch)
treedf4288713dd999fd2b0783cf0f82a7a127ed5964 /libsanitizer/sanitizer_common/sanitizer_allocator.cpp
parent2b11374cb8d864dff3792e7c84188ba7e8f136e7 (diff)
downloadgcc-3c6331c29f1376ed220246e7dead94bc527a9aa9.zip
gcc-3c6331c29f1376ed220246e7dead94bc527a9aa9.tar.gz
gcc-3c6331c29f1376ed220246e7dead94bc527a9aa9.tar.bz2
Libsanitizer: merge from master.
Merged from revision b638b63b99d66786cb37336292604a2ae3490cfd. The patch successfully bootstraps on x86_64-linux-gnu and ppc64le-linux-gnu. I also tested ppc64-linux-gnu that exposed: https://reviews.llvm.org/D80864 (which is fixed on master). Abidiff looks happy and I made UBSAN and ASAN bootstrap on x86_64-linux-gnu. I'm planning to do merge from master twice a year, once now and next time short before stage1 closes. I am going to install the patches as merge from master is obvious and I haven't made anything special. libsanitizer/ChangeLog: * MERGE: Merge from master.
Diffstat (limited to 'libsanitizer/sanitizer_common/sanitizer_allocator.cpp')
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_allocator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_allocator.cpp b/libsanitizer/sanitizer_common/sanitizer_allocator.cpp
index 8d07906..ec77b9c 100644
--- a/libsanitizer/sanitizer_common/sanitizer_allocator.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_allocator.cpp
@@ -25,7 +25,7 @@ const char *PrimaryAllocatorName = "SizeClassAllocator";
const char *SecondaryAllocatorName = "LargeMmapAllocator";
// ThreadSanitizer for Go uses libc malloc/free.
-#if SANITIZER_GO || defined(SANITIZER_USE_MALLOC)
+#if defined(SANITIZER_USE_MALLOC)
# if SANITIZER_LINUX && !SANITIZER_ANDROID
extern "C" void *__libc_malloc(uptr size);
# if !SANITIZER_GO
@@ -213,7 +213,7 @@ void *LowLevelAllocator::Allocate(uptr size) {
// Align allocation size.
size = RoundUpTo(size, low_level_alloc_min_alignment);
if (allocated_end_ - allocated_current_ < (sptr)size) {
- uptr size_to_allocate = Max(size, GetPageSizeCached());
+ uptr size_to_allocate = RoundUpTo(size, GetPageSizeCached());
allocated_current_ =
(char*)MmapOrDie(size_to_allocate, __func__);
allocated_end_ = allocated_current_ + size_to_allocate;