diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-06 11:11:48 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-03-06 11:43:06 -0800 |
commit | 6dda898d47b3e8931e4404330e81b7110108e34f (patch) | |
tree | d8a0a20b8ac1ce3cd44273cf5c748d09980bd800 /runtime/gc | |
parent | 8785d615122d4abbd22db702139584e8c472f502 (diff) | |
download | art-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.cc | 10 | ||||
-rw-r--r-- | runtime/gc/heap.h | 3 |
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_; } |