Add a predicate that returns true for addresses contained by the heap.
Change-Id: Iaa2978c59fc314563555b14f53bdc28be6b71cc4
diff --git a/vm/alloc/Alloc.c b/vm/alloc/Alloc.c
index 5d814b3..8269290 100644
--- a/vm/alloc/Alloc.c
+++ b/vm/alloc/Alloc.c
@@ -340,3 +340,8 @@
dvmUnlockHeap();
return ctx.count;
}
+
+bool dvmIsHeapAddress(void *address)
+{
+ return dvmHeapSourceContainsAddress(address);
+}
diff --git a/vm/alloc/Alloc.h b/vm/alloc/Alloc.h
index 4222ee4..2dc2ae6 100644
--- a/vm/alloc/Alloc.h
+++ b/vm/alloc/Alloc.h
@@ -137,4 +137,9 @@
*/
void dvmClearGrowthLimit(void);
+/*
+ * Returns true if the address is within the bounds of the heap.
+ */
+bool dvmIsHeapAddress(void *address);
+
#endif /*_DALVIK_ALLOC_ALLOC*/