diff options
author | Richard Uhler <ruhler@google.com> | 2017-12-01 10:50:35 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-12-01 10:50:35 +0000 |
commit | c3d216eae897d216e5d57d47985f9ccf7ae95e16 (patch) | |
tree | d27d164294edb8f42ee536169fc6d6b609e00abf /dalvik | |
parent | 929e47a30ee955cf28083df83fdb3f3f3b1d3233 (diff) | |
parent | e7aad93b91da81a32ebcbf7913bded3c8edc662a (diff) | |
download | libcore-c3d216eae897d216e5d57d47985f9ccf7ae95e16.tar.gz |
Merge "Add VMDebug.getInstancesOfClasses API."
am: e7aad93b91
Change-Id: If6910f96f9a627d1470448d7e183ddcce54d3245
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/VMDebug.java | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/dalvik/src/main/java/dalvik/system/VMDebug.java b/dalvik/src/main/java/dalvik/system/VMDebug.java index fe8294b954a..c1290ffef2a 100644 --- a/dalvik/src/main/java/dalvik/system/VMDebug.java +++ b/dalvik/src/main/java/dalvik/system/VMDebug.java @@ -393,10 +393,10 @@ public final class VMDebug { * objects to get counted. * * @param klass the class to be counted. - * @param assignable if false, direct instances of klass are - * counted. If true, instances that are - * assignable to klass, as defined by - * {@link Class#isAssignableFrom} are counted. + * @param assignable if true, any instance whose class is assignable to + * <code>klass</code>, as defined by {@link Class#isAssignableFrom}, + * is counted. If false, only instances whose class is + * equal to <code>klass</code> are counted. * @return the number of matching instances. */ public static native long countInstancesOfClass(Class klass, boolean assignable); @@ -407,16 +407,33 @@ public final class VMDebug { * objects to get counted. * * @param classes the classes to be counted. - * @param assignable if false, direct instances of klass are - * counted. If true, instances that are - * assignable to klass, as defined by - * {@link Class#isAssignableFrom} are counted. - * @return an array containing the number of matching instances. The value for - * an index is the number of instances of the class at that index in number classes. + * @param assignable if true, any instance whose class is assignable to + * <code>classes[i]</code>, as defined by {@link Class#isAssignableFrom}, + * is counted. If false, only instances whose class is + * equal to <code>classes[i]</code> are counted. + * @return an array containing the number of matching instances. The value + * for index <code>i</code> is the number of instances of + * the class <code>classes[i]</code> */ public static native long[] countInstancesOfClasses(Class[] classes, boolean assignable); /** + * Gets instances of classes on the Java heap. + * It is the caller's responsibility to do GC if they don't want unreachable + * objects to be included. + * + * @param classes the classes to get instances of. + * @param assignable if true, any instance whose class is assignable to + * <code>classes[i]</code>, as defined by {@link Class#isAssignableFrom}, + * is included. If false, only instances whose class is + * equal to <code>classes[i]</code> are included. + * @return an array containing the list of matching instances. The value + * for index <code>i</code> is an array containing the instances + * of the class <code>classes[i]</code> + */ + public static native Object[][] getInstancesOfClasses(Class[] classes, boolean assignable); + + /** * Export the heap per-space stats for dumpsys meminfo. * * The content of the array is: |