summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-05-03 08:28:13 -0700
committer Andreas Gampe <agampe@google.com> 2017-05-03 21:45:07 -0700
commite8857fe3349af3900ef5b6ba65627c82cb13a2c2 (patch)
treee562ec28d4ef492f666ada28d3b007e14a2ee3c6
parent90c5ccbc1d2988f6274877547ff095c0f29ff77a (diff)
ART: Change alloc-space begin for x86 ASAN
Move the preferred AllocSpace begin to 0x40000000, as lower memory is mostly reserved by ASAN. This does not seem to apply to arm32. Bug: 31098551 Bug: 37728308 Test: m SANITIZE_HOST=address test-art-host-gtest32 Test: lunch aosp_bullhead && m && m SANITIZE_TARGET=address # device boots Change-Id: I2c6508305e62040b0679dfe483c76fd283dba9de
-rw-r--r--runtime/gc/heap.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index bd4f99b7f5..298336ae4d 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -150,8 +150,13 @@ static constexpr bool kUsePartialTlabs = true;
static uint8_t* const kPreferredAllocSpaceBegin =
reinterpret_cast<uint8_t*>(300 * MB - Heap::kDefaultNonMovingSpaceCapacity);
#else
-// For 32-bit, use 0x20000000 because asan reserves 0x04000000 - 0x20000000.
+#ifdef __ANDROID__
+// For 32-bit Android, use 0x20000000 because asan reserves 0x04000000 - 0x20000000.
static uint8_t* const kPreferredAllocSpaceBegin = reinterpret_cast<uint8_t*>(0x20000000);
+#else
+// For 32-bit host, use 0x40000000 because asan uses most of the space below this.
+static uint8_t* const kPreferredAllocSpaceBegin = reinterpret_cast<uint8_t*>(0x40000000);
+#endif
#endif
static inline bool CareAboutPauseTimes() {