Add -Xcheck:jni.
I think this is as complete as possible right now. The remaining
two #if 0 sections require:
1. a way to get the Method* of the current native method.
2. a way to get the Class* of the type of a given Field*.
Change-Id: I331586022095fb36ccc10c9ac1890a59a9224d01
diff --git a/src/heap.h b/src/heap.h
index 1e56778..bbd05db 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -33,9 +33,14 @@
// Allocates and initializes storage for an object instance.
static Object* AllocObject(Class* klass, size_t num_bytes);
- // Check sanity of given reference
+ // Check sanity of given reference. Requires the heap lock.
static void VerifyObject(Object *obj);
+ // A weaker test than VerifyObject that doesn't require the heap lock,
+ // and doesn't abort on error, allowing the caller to report more
+ // meaningful diagnostics.
+ static bool IsHeapAddress(Object* obj);
+
// Initiates an explicit garbage collection.
static void CollectGarbage();