diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2014-02-04 18:12:17 -0800 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2014-02-07 15:33:21 -0800 |
commit | a4adbfd44032d70e166e6f18096bbbed05a990ba (patch) | |
tree | 8fe1c7e9e0a12ca5d97de79f034978cadf25b391 /runtime/runtime.cc | |
parent | 6957616884d7b290f2b8e98e2c4304695799134b (diff) | |
download | art-a4adbfd44032d70e166e6f18096bbbed05a990ba.zip art-a4adbfd44032d70e166e6f18096bbbed05a990ba.tar.gz art-a4adbfd44032d70e166e6f18096bbbed05a990ba.tar.bz2 |
RosAlloc verification.
If enabled, RosAlloc verification checks the allocator internal
metadata and invariants to detect bugs, heap corruptions, and race
conditions. Added runtime options for enabling and disabling
it. Enable it for the debug build.
Bug: 9986565
Bug: 12592026
Change-Id: I923742b87805ae839f1549d78d0d492733da6a58
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 4e90478..17afb43 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -429,6 +429,8 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b parsed->use_tlab_ = false; parsed->verify_pre_gc_heap_ = false; parsed->verify_post_gc_heap_ = kIsDebugBuild; + parsed->verify_pre_gc_rosalloc_ = kIsDebugBuild; + parsed->verify_post_gc_rosalloc_ = false; parsed->compiler_callbacks_ = nullptr; parsed->is_zygote_ = false; @@ -615,12 +617,20 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b parsed->collector_type_ = collector_type; } else if (gc_option == "preverify") { parsed->verify_pre_gc_heap_ = true; - } else if (gc_option == "nopreverify") { + } else if (gc_option == "nopreverify") { parsed->verify_pre_gc_heap_ = false; } else if (gc_option == "postverify") { parsed->verify_post_gc_heap_ = true; } else if (gc_option == "nopostverify") { parsed->verify_post_gc_heap_ = false; + } else if (gc_option == "preverify_rosalloc") { + parsed->verify_pre_gc_rosalloc_ = true; + } else if (gc_option == "nopreverify_rosalloc") { + parsed->verify_pre_gc_rosalloc_ = false; + } else if (gc_option == "postverify_rosalloc") { + parsed->verify_post_gc_rosalloc_ = true; + } else if (gc_option == "nopostverify_rosalloc") { + parsed->verify_post_gc_rosalloc_ = false; } else { LOG(WARNING) << "Ignoring unknown -Xgc option: " << gc_option; } @@ -1018,7 +1028,9 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) { options->ignore_max_footprint_, options->use_tlab_, options->verify_pre_gc_heap_, - options->verify_post_gc_heap_); + options->verify_post_gc_heap_, + options->verify_pre_gc_rosalloc_, + options->verify_post_gc_rosalloc_); dump_gc_performance_on_shutdown_ = options->dump_gc_performance_on_shutdown_; |