summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-03-06 11:11:48 -0800
committerMathieu Chartier <mathieuc@google.com>2014-03-06 11:43:06 -0800
commit6dda898d47b3e8931e4404330e81b7110108e34f (patch)
treed8a0a20b8ac1ce3cd44273cf5c748d09980bd800 /runtime/gc
parent8785d615122d4abbd22db702139584e8c472f502 (diff)
downloadart-6dda898d47b3e8931e4404330e81b7110108e34f.zip
art-6dda898d47b3e8931e4404330e81b7110108e34f.tar.gz
art-6dda898d47b3e8931e4404330e81b7110108e34f.tar.bz2
Disable compaction for jni workarounds.
Compaction can't work when jni workarounds is enabled. Also some other refactoring. Change-Id: Ia7b0f2b39c79f5a0a5f50874d823b950ab02a0c3
Diffstat (limited to 'runtime/gc')
-rw-r--r--runtime/gc/heap.cc10
-rw-r--r--runtime/gc/heap.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 87ee21b..1fcbe4d 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -318,6 +318,16 @@ void Heap::ChangeAllocator(AllocatorType allocator) {
}
}
+void Heap::DisableCompaction() {
+ if (IsCompactingGC(post_zygote_collector_type_)) {
+ post_zygote_collector_type_ = kCollectorTypeCMS;
+ }
+ if (IsCompactingGC(background_collector_type_)) {
+ background_collector_type_ = post_zygote_collector_type_;
+ }
+ TransitionCollector(post_zygote_collector_type_);
+}
+
std::string Heap::SafeGetClassDescriptor(mirror::Class* klass) {
if (!IsValidContinuousSpaceObjectAddress(klass)) {
return StringPrintf("<non heap address klass %p>", klass);
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 88adf81..a90af27 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -487,6 +487,9 @@ class Heap {
// Assumes there is only one image space.
space::ImageSpace* GetImageSpace() const;
+ // Permenantly disable compaction.
+ void DisableCompaction();
+
space::DlMallocSpace* GetDlMallocSpace() const {
return dlmalloc_space_;
}