summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2011-09-02 18:26:12 -0700
committer Elliott Hughes <enh@google.com> 2011-09-02 18:26:12 -0700
commit3e465b1a72d89f7c30f18efb90dc688d33d46c16 (patch)
tree2bac1709132fd261d54abdb3601f64065ea210b7
parent0db460b881a3fdaa63d581a1dc39e417d682faaa (diff)
Get the test speed back to where it was.
(This patch actually has an active ingredient, unlike my last screwup.) Change-Id: Ic9f48a1c7c62ea024c51dc57e245a7d4df068db0
-rw-r--r--src/common_test.h1
-rw-r--r--src/heap.cc2
-rw-r--r--src/heap.h6
3 files changed, 8 insertions, 1 deletions
diff --git a/src/common_test.h b/src/common_test.h
index 5943714d9d..5318008c9b 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -90,7 +90,6 @@ class CommonTest : public testing::Test {
ASSERT_TRUE(runtime_.get() != NULL);
class_linker_ = runtime_->GetClassLinker();
- //Heap::DisableObjectValidation();
Heap::VerifyHeap(); // Check for heap corruption before the test
}
diff --git a/src/heap.cc b/src/heap.cc
index cb5e0dc748..be3d154408 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -132,6 +132,7 @@ bool Heap::IsHeapAddress(const Object* obj) {
bool Heap::verify_object_disabled_;
+#if VERIFY_OBJECT_ENABLED
void Heap::VerifyObject(const Object* obj) {
if (obj != NULL && !verify_object_disabled_) {
if (!IsAligned(obj, kObjectAlignment)) {
@@ -166,6 +167,7 @@ void Heap::VerifyObject(const Object* obj) {
}
}
}
+#endif
static void HeapVerifyCallback(Object* obj, void *arg) {
DCHECK(obj != NULL);
diff --git a/src/heap.h b/src/heap.h
index bc06289d51..5168fe730c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -9,6 +9,8 @@
#include "object_bitmap.h"
#include "offsets.h"
+#define VERIFY_OBJECT_ENABLED 0
+
namespace art {
class Class;
@@ -35,7 +37,11 @@ class Heap {
static Object* AllocObject(Class* klass, size_t num_bytes);
// Check sanity of given reference. Requires the heap lock.
+#if VERIFY_OBJECT_ENABLED
static void VerifyObject(const Object *obj);
+#else
+ static void VerifyObject(const Object *obj) {}
+#endif
// Check sanity of all live references. Requires the heap lock.
static void VerifyHeap();