Declare mmapped_bytes only if needed
Also needed to unbreak the Mac build.
Test: TreeHugger
Bug: 111447610
Change-Id: If78f1905519521ad9ba78e913c67917d388301a2
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index f2c924a..d47aca9 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2624,8 +2624,8 @@
size_t Heap::GetNativeBytes() {
size_t malloc_bytes;
- size_t mmapped_bytes;
#if defined(__BIONIC__) || defined(__GLIBC__)
+ size_t mmapped_bytes;
struct mallinfo mi = mallinfo();
// In spite of the documentation, the jemalloc version of this call seems to do what we want,
// and it is thread-safe.