summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/Android.common_build.mk4
-rw-r--r--runtime/globals.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 63469703f2..7620e760cb 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -237,6 +237,10 @@ ifeq ($(ART_USE_OPTIMIZING_COMPILER),true)
art_cflags += -DART_USE_OPTIMIZING_COMPILER=1
endif
+ifeq ($(ART_HEAP_POISONING),true)
+ art_cflags += -DART_HEAP_POISONING=1
+endif
+
# Cflags for non-debug ART and ART tools.
art_non_debug_cflags := \
-O3
diff --git a/runtime/globals.h b/runtime/globals.h
index 3104229b17..beabf55a13 100644
--- a/runtime/globals.h
+++ b/runtime/globals.h
@@ -101,7 +101,11 @@ static constexpr bool kUseBrooksReadBarrier = false;
static constexpr bool kUseBakerOrBrooksReadBarrier = kUseBakerReadBarrier || kUseBrooksReadBarrier;
// If true, references within the heap are poisoned (negated).
+#ifdef ART_HEAP_POISONING
+static constexpr bool kPoisonHeapReferences = true;
+#else
static constexpr bool kPoisonHeapReferences = false;
+#endif
// Kinds of tracing clocks.
enum TraceClockSource {