From 3eed93dd5be03e5539827bebf0f414251a12e15e Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Wed, 4 Jun 2014 11:43:59 -0700 Subject: Verify there's no mem map gap for immune region not to break. This adds code that verifies that there's no memory map gap between the image space and the main space so that the immune region functionality won't silently break. For example, if there's a gap and a large object is allocated in that gap, the large object is incorrectly part of the immune region and the marking breaks. Bug: 14059466 Change-Id: Ie6ed82988d74b6d0562ebbbaac96ee43c15b14a6 --- runtime/base/mutex.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/base/mutex.cc') diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index d2b4e01ff7..11698e2746 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -35,6 +35,7 @@ Mutex* Locks::breakpoint_lock_ = nullptr; ReaderWriterMutex* Locks::classlinker_classes_lock_ = nullptr; ReaderWriterMutex* Locks::heap_bitmap_lock_ = nullptr; Mutex* Locks::logging_lock_ = nullptr; +Mutex* Locks::mem_maps_lock_ = nullptr; Mutex* Locks::modify_ldt_lock_ = nullptr; ReaderWriterMutex* Locks::mutator_lock_ = nullptr; Mutex* Locks::runtime_shutdown_lock_ = nullptr; @@ -900,6 +901,10 @@ void Locks::Init() { DCHECK(unexpected_signal_lock_ == nullptr); unexpected_signal_lock_ = new Mutex("unexpected signal lock", current_lock_level, true); + UPDATE_CURRENT_LOCK_LEVEL(kMemMapsLock); + DCHECK(mem_maps_lock_ == nullptr); + mem_maps_lock_ = new Mutex("mem maps lock", current_lock_level); + UPDATE_CURRENT_LOCK_LEVEL(kLoggingLock); DCHECK(logging_lock_ == nullptr); logging_lock_ = new Mutex("logging lock", current_lock_level, true); -- cgit v1.2.3-59-g8ed1b