summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-10 23:43:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-10 23:43:32 +0000
commitb9620f305c79914f5159cf9279a7ccd173af1186 (patch)
treeedfb15d759f16808d575cb849302fc2fd22d6709 /runtime/runtime.cc
parent575a5649715ee50e0de8a107e8a5379d4c465382 (diff)
parent928f72bd75c385ba2708c58521171a77264d4486 (diff)
downloadart-b9620f305c79914f5159cf9279a7ccd173af1186.tar.gz
art-b9620f305c79914f5159cf9279a7ccd173af1186.tar.bz2
art-b9620f305c79914f5159cf9279a7ccd173af1186.zip
Merge "ART: Fix things for valgrind"
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 105c01110f..474b72dbd7 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -139,9 +139,6 @@ Runtime::Runtime()
system_class_loader_(nullptr),
dump_gc_performance_on_shutdown_(false),
preinitialization_transaction_(nullptr),
- null_pointer_handler_(nullptr),
- suspend_handler_(nullptr),
- stack_overflow_handler_(nullptr),
verify_(false),
target_sdk_version_(0),
implicit_null_checks_(false),
@@ -199,10 +196,6 @@ Runtime::~Runtime() {
// TODO: acquire a static mutex on Runtime to avoid racing.
CHECK(instance_ == nullptr || instance_ == this);
instance_ = nullptr;
-
- delete null_pointer_handler_;
- delete suspend_handler_;
- delete stack_overflow_handler_;
}
struct AbortState {
@@ -731,7 +724,8 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
case kArm64:
case kX86_64:
implicit_null_checks_ = true;
- implicit_so_checks_ = true;
+ // Installing stack protection does not play well with valgrind.
+ implicit_so_checks_ = (RUNNING_ON_VALGRIND == 0);
break;
default:
// Keep the defaults.
@@ -743,16 +737,19 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
// These need to be in a specific order. The null point check handler must be
// after the suspend check and stack overflow check handlers.
+ //
+ // Note: the instances attach themselves to the fault manager and are handled by it. The manager
+ // will delete the instance on Shutdown().
if (implicit_suspend_checks_) {
- suspend_handler_ = new SuspensionHandler(&fault_manager);
+ new SuspensionHandler(&fault_manager);
}
if (implicit_so_checks_) {
- stack_overflow_handler_ = new StackOverflowHandler(&fault_manager);
+ new StackOverflowHandler(&fault_manager);
}
if (implicit_null_checks_) {
- null_pointer_handler_ = new NullPointerHandler(&fault_manager);
+ new NullPointerHandler(&fault_manager);
}
if (kEnableJavaStackTraceHandler) {