diff options
Diffstat (limited to 'runtime/base')
| -rw-r--r-- | runtime/base/mutex.cc | 4 | ||||
| -rw-r--r-- | runtime/base/mutex.h | 1 | ||||
| -rw-r--r-- | runtime/base/scoped_arena_containers.h | 9 |
3 files changed, 6 insertions, 8 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 82a5f9611c..6972b3ef3f 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -1009,10 +1009,6 @@ void Locks::Init() { DCHECK(alloc_tracker_lock_ == nullptr); alloc_tracker_lock_ = new Mutex("AllocTracker lock", current_lock_level); - UPDATE_CURRENT_LOCK_LEVEL(kInterpreterStringInitMapLock); - DCHECK(interpreter_string_init_map_lock_ == nullptr); - interpreter_string_init_map_lock_ = new Mutex("Interpreter String initializer reference map lock", current_lock_level); - UPDATE_CURRENT_LOCK_LEVEL(kThreadListLock); DCHECK(thread_list_lock_ == nullptr); thread_list_lock_ = new Mutex("thread list lock", current_lock_level); diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index f674a6f3c8..e72f2a2e7b 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -102,7 +102,6 @@ enum LockLevel { kMonitorListLock, kJniLoadLibraryLock, kThreadListLock, - kInterpreterStringInitMapLock, kAllocTrackerLock, kDeoptimizationLock, kProfilerLock, diff --git a/runtime/base/scoped_arena_containers.h b/runtime/base/scoped_arena_containers.h index 9b56856f11..bd19d00544 100644 --- a/runtime/base/scoped_arena_containers.h +++ b/runtime/base/scoped_arena_containers.h @@ -201,11 +201,12 @@ inline ScopedArenaAllocatorAdapter<void> ScopedArenaAllocator::Adapter(ArenaAllo template <typename T> class ArenaDelete { static constexpr uint8_t kMagicFill = 0xCE; + protected: // Used for variable sized objects such as RegisterLine. ALWAYS_INLINE void ProtectMemory(T* ptr, size_t size) const { if (RUNNING_ON_MEMORY_TOOL > 0) { - // Writing to the memory will fail if it we already destroyed the pointer with + // Writing to the memory will fail ift we already destroyed the pointer with // DestroyOnlyDelete since we make it no access. memset(ptr, kMagicFill, size); MEMORY_TOOL_MAKE_NOACCESS(ptr, size); @@ -220,8 +221,10 @@ class ArenaDelete { public: void operator()(T* ptr) const { - ptr->~T(); - ProtectMemory(ptr, sizeof(T)); + if (ptr != nullptr) { + ptr->~T(); + ProtectMemory(ptr, sizeof(T)); + } } }; |