Add interface for updating the heap's process state
In the future, the heap's process state will be used
to determine GC behavior.
Change-Id: Iba4f038d28dbf483b6573d8feb25e4246ead1d50
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index deb1b8c..0de5a71 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -57,7 +57,7 @@
// When to create a log message about a slow GC, 100ms.
static const uint64_t kSlowGcThreshold = MsToNs(100);
-// When to create a log message about a slow pause, 5ms.
+// When to create a log message about a long pause, 5ms.
static const uint64_t kLongGcPauseThreshold = MsToNs(5);
static const bool kDumpGcPerformanceOnShutdown = false;
// Minimum amount of remaining bytes before a concurrent GC is triggered.
@@ -84,6 +84,7 @@
total_objects_freed_ever_(0),
large_object_threshold_(3 * kPageSize),
num_bytes_allocated_(0),
+ process_state_(PROCESS_STATE_TOP),
verify_missing_card_marks_(false),
verify_system_weaks_(false),
verify_pre_gc_heap_(false),
@@ -233,6 +234,10 @@
}
};
+void Heap::UpdateProcessState(ProcessState process_state) {
+ process_state_ = process_state;
+}
+
void Heap::AddContinuousSpace(space::ContinuousSpace* space) {
WriterMutexLock mu(Thread::Current(), *Locks::heap_bitmap_lock_);
DCHECK(space != NULL);