Fix address space conflict with asan in 32-bit.

Asan reserves 0x04000000 - 0x20000000 in 32-bit.

Bug: 34606909
Test: marlin-userdebug asan coverage build boots.
Test: test-art-host
Change-Id: I3ee9cd290cd02de02e7d6c79b854479a985549c3
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index f5bf935..aa15714 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -293,8 +293,13 @@
   if (foreground_collector_type_ == kCollectorTypeCC) {
     // Need to use a low address so that we can allocate a contiguous
     // 2 * Xmx space when there's no image (dex2oat for target).
+#if defined(__LP64__)
     CHECK_GE(300 * MB, non_moving_space_capacity);
     requested_alloc_space_begin = reinterpret_cast<uint8_t*>(300 * MB) - non_moving_space_capacity;
+#else
+    // For 32-bit, use 0x20000000 because asan reserves 0x04000000 - 0x20000000.
+    requested_alloc_space_begin = reinterpret_cast<uint8_t*>(0x20000000);
+#endif
   }
 
   // Load image space(s).
@@ -369,7 +374,12 @@
                              &error_str));
     CHECK(non_moving_space_mem_map != nullptr) << error_str;
     // Try to reserve virtual memory at a lower address if we have a separate non moving space.
+#if defined(__LP64__)
     request_begin = reinterpret_cast<uint8_t*>(300 * MB);
+#else
+    // For 32-bit, use 0x20000000 because asan reserves 0x04000000 - 0x20000000.
+    request_begin = reinterpret_cast<uint8_t*>(0x20000000) + non_moving_space_capacity;
+#endif
   }
   // Attempt to create 2 mem maps at or after the requested begin.
   if (foreground_collector_type_ != kCollectorTypeCC) {