diff options
| -rw-r--r-- | runtime/gc/heap.cc | 6 | ||||
| -rw-r--r-- | runtime/gc/heap.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index d37f2ad960..e7f7517b00 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -116,6 +116,7 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max long_pause_log_threshold_(long_pause_log_threshold), long_gc_log_threshold_(long_gc_log_threshold), ignore_max_footprint_(ignore_max_footprint), + zygote_creation_lock_("zygote creation lock", kZygoteCreationLock), have_zygote_space_(false), large_object_threshold_(std::numeric_limits<size_t>::max()), // Starts out disabled. collector_type_running_(kCollectorTypeNone), @@ -1551,7 +1552,6 @@ void Heap::UnBindBitmaps() { void Heap::PreZygoteFork() { CollectGarbageInternal(collector::kGcTypeFull, kGcCauseBackground, false); - static Mutex zygote_creation_lock_("zygote creation lock", kZygoteCreationLock); Thread* self = Thread::Current(); MutexLock mu(self, zygote_creation_lock_); // Try to see if we have any Zygote spaces. @@ -2781,9 +2781,9 @@ void Heap::AddRememberedSet(accounting::RememberedSet* remembered_set) { CHECK(remembered_set != nullptr); space::Space* space = remembered_set->GetSpace(); CHECK(space != nullptr); - CHECK(remembered_sets_.find(space) == remembered_sets_.end()); + CHECK(remembered_sets_.find(space) == remembered_sets_.end()) << space; remembered_sets_.Put(space, remembered_set); - CHECK(remembered_sets_.find(space) != remembered_sets_.end()); + CHECK(remembered_sets_.find(space) != remembered_sets_.end()) << space; } void Heap::RemoveRememberedSet(space::Space* space) { diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index 6fe0dcf24e..890332a33e 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -778,6 +778,9 @@ class Heap { // useful for benchmarking since it reduces time spent in GC to a low %. const bool ignore_max_footprint_; + // Lock which guards zygote space creation. + Mutex zygote_creation_lock_; + // If we have a zygote space. bool have_zygote_space_; |