diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-10-14 15:01:24 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-10-14 15:43:21 -0700 |
commit | 6e88ef6b604a7a945a466784580c42e6554c1289 (patch) | |
tree | 1e296564787b51514cf2eca5b732647c1a82912e /runtime/mem_map.h | |
parent | 58e51f38e2304a08aa9ec380383e0b3614f96a96 (diff) | |
download | android_art-6e88ef6b604a7a945a466784580c42e6554c1289.tar.gz android_art-6e88ef6b604a7a945a466784580c42e6554c1289.tar.bz2 android_art-6e88ef6b604a7a945a466784580c42e6554c1289.zip |
Change MemMap::maps_ to not be global variable
Runtime.exit() was causing globals to get destructed at the same time
that another thread was using it for allocating a new mem map.
Bug: 17962201
Change-Id: I400cb7b8141d858f3c08a6fe59a02838c04c6962
Diffstat (limited to 'runtime/mem_map.h')
-rw-r--r-- | runtime/mem_map.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/mem_map.h b/runtime/mem_map.h index 314bf8d800..df1222c39d 100644 --- a/runtime/mem_map.h +++ b/runtime/mem_map.h @@ -138,6 +138,9 @@ class MemMap { typedef AllocationTrackingMultiMap<void*, MemMap*, kAllocatorTagMaps> Maps; + static void Init() LOCKS_EXCLUDED(Locks::mem_maps_lock_); + static void Shutdown() LOCKS_EXCLUDED(Locks::mem_maps_lock_); + private: MemMap(const std::string& name, uint8_t* begin, size_t size, void* base_begin, size_t base_size, int prot, bool reuse) LOCKS_EXCLUDED(Locks::mem_maps_lock_); @@ -167,7 +170,7 @@ class MemMap { #endif // All the non-empty MemMaps. Use a multimap as we do a reserve-and-divide (eg ElfMap::Load()). - static Maps maps_ GUARDED_BY(Locks::mem_maps_lock_); + static Maps* maps_ GUARDED_BY(Locks::mem_maps_lock_); friend class MemMapTest; // To allow access to base_begin_ and base_size_. }; |