Fix a per-process dumpsys meminfo crash.

In the InvalidateAllocator() function, DlMallocSpace and RosAllocSpace
both null out the underlying allocator pointer at the zygote fork time
so that new allocations won't accidentally happen in the zygote space
after a zygote fork. However, nulling out the only allocator pointer
would cause crashes in non-allocation uses such as GetFootprint() in
this particular crash. Fix this by creating a second pointer just for
the allocation purpose that gets nulled upon a InvalidateAllocator()
call while the original pointer keeps pointing to the allocator.

Change-Id: Ie751d9380db39baace9e25712a3824eec9a9969a
diff --git a/runtime/gc/space/dlmalloc_space.h b/runtime/gc/space/dlmalloc_space.h
index 1cfee7a..d18d4ad 100644
--- a/runtime/gc/space/dlmalloc_space.h
+++ b/runtime/gc/space/dlmalloc_space.h
@@ -97,7 +97,7 @@
   mirror::Class* FindRecentFreedObject(const mirror::Object* obj);
 
   virtual void InvalidateAllocator() {
-    mspace_ = nullptr;
+    mspace_for_alloc_ = nullptr;
   }
 
   virtual bool IsDlMallocSpace() const {
@@ -130,7 +130,11 @@
   static const size_t kChunkOverhead = kWordSize;
 
   // Underlying malloc space
-  void* mspace_;
+  void* const mspace_;
+
+  // A mspace pointer used for allocation. Equals to what mspace_
+  // points to or nullptr after InvalidateAllocator() is called.
+  void* mspace_for_alloc_;
 
   friend class collector::MarkSweep;