summaryrefslogtreecommitdiffstats
path: root/runtime/base/allocator.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-10-14 15:01:24 -0700
committerMathieu Chartier <mathieuc@google.com>2014-10-14 15:43:21 -0700
commit6e88ef6b604a7a945a466784580c42e6554c1289 (patch)
tree1e296564787b51514cf2eca5b732647c1a82912e /runtime/base/allocator.cc
parent58e51f38e2304a08aa9ec380383e0b3614f96a96 (diff)
downloadart-6e88ef6b604a7a945a466784580c42e6554c1289.tar.gz
art-6e88ef6b604a7a945a466784580c42e6554c1289.tar.bz2
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/base/allocator.cc')
-rw-r--r--runtime/base/allocator.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/base/allocator.cc b/runtime/base/allocator.cc
index f67616ef0d..994e2357af 100644
--- a/runtime/base/allocator.cc
+++ b/runtime/base/allocator.cc
@@ -74,6 +74,7 @@ Allocator* Allocator::GetNoopAllocator() {
namespace TrackedAllocators {
+// These globals are safe since they don't have any non-trivial destructors.
Atomic<size_t> g_bytes_used[kAllocatorTagCount];
volatile size_t g_max_bytes_used[kAllocatorTagCount];
Atomic<uint64_t> g_total_bytes_used[kAllocatorTagCount];