Always support debugging and profiling.
This eliminates the use of the WITH_DEBUGGER and WITH_PROFILER
conditional compilation flags. We've never shipped a device without
these features, and it's unlikely we ever will. They're not worth
the code clutter they cause.
As usual, since I can't test the x86-atom code I left that alone and
added an item to the TODO list.
Bug 2923442.
Change-Id: I335ebd5193bc86f7641513b1b41c0378839be1fe
diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c
index ed5f081..7e381c5 100644
--- a/vm/alloc/HeapSource.c
+++ b/vm/alloc/HeapSource.c
@@ -1581,7 +1581,7 @@
*/
if (hs->externalBytesAllocated + n <= hs->externalLimit) {
hs->externalBytesAllocated += n;
-#if defined(WITH_PROFILER) && PROFILE_EXTERNAL_ALLOCATIONS
+#if PROFILE_EXTERNAL_ALLOCATIONS
if (gDvm.allocProf.enabled) {
Thread* self = dvmThreadSelf();
gDvm.allocProf.externalAllocCount++;
@@ -1609,7 +1609,6 @@
static void
gcForExternalAlloc(bool collectSoftReferences)
{
-#ifdef WITH_PROFILER // even if !PROFILE_EXTERNAL_ALLOCATIONS
if (gDvm.allocProf.enabled) {
Thread* self = dvmThreadSelf();
gDvm.allocProf.gcCount++;
@@ -1617,7 +1616,6 @@
self->allocProf.gcCount++;
}
}
-#endif
dvmCollectGarbageInternal(collectSoftReferences, GC_EXTERNAL_ALLOC);
}
@@ -1699,7 +1697,7 @@
LOGE_HEAP("Out of external memory on a %zu-byte allocation.\n", n);
}
-#if defined(WITH_PROFILER) && PROFILE_EXTERNAL_ALLOCATIONS
+#if PROFILE_EXTERNAL_ALLOCATIONS
if (gDvm.allocProf.enabled) {
Thread* self = dvmThreadSelf();
gDvm.allocProf.failedExternalAllocCount++;
@@ -1746,7 +1744,7 @@
hs->externalBytesAllocated = 0;
}
-#if defined(WITH_PROFILER) && PROFILE_EXTERNAL_ALLOCATIONS
+#if PROFILE_EXTERNAL_ALLOCATIONS
if (gDvm.allocProf.enabled) {
Thread* self = dvmThreadSelf();
gDvm.allocProf.externalFreeCount++;