Search in sources :

Example 1 with Type

use of com.squareup.haha.perflib.Type in project leakcanary by square.

the class ShortestPathFinder method visitArrayInstance.

private void visitArrayInstance(LeakNode node) {
    ArrayInstance arrayInstance = (ArrayInstance) node.instance;
    Type arrayType = arrayInstance.getArrayType();
    if (arrayType == Type.OBJECT) {
        Object[] values = arrayInstance.getValues();
        for (int i = 0; i < values.length; i++) {
            Instance child = (Instance) values[i];
            enqueue(null, node, child, "[" + i + "]", ARRAY_ENTRY);
        }
    }
}
Also used : Type(com.squareup.haha.perflib.Type) RootType(com.squareup.haha.perflib.RootType) Instance(com.squareup.haha.perflib.Instance) ClassInstance(com.squareup.haha.perflib.ClassInstance) ArrayInstance(com.squareup.haha.perflib.ArrayInstance) ArrayInstance(com.squareup.haha.perflib.ArrayInstance)

Aggregations

ArrayInstance (com.squareup.haha.perflib.ArrayInstance)1 ClassInstance (com.squareup.haha.perflib.ClassInstance)1 Instance (com.squareup.haha.perflib.Instance)1 RootType (com.squareup.haha.perflib.RootType)1 Type (com.squareup.haha.perflib.Type)1