MCPcopy Create free account
hub / github.com/buggins/coolreader / dumpFields

Method dumpFields

android/src/org/coolreader/CoolReader.java:2029–2043  ·  view source on GitHub ↗
( Field[] fields, Object obj)

Source from the content-addressed store, hash-verified

2027 private static Debug.MemoryInfo info = new Debug.MemoryInfo();
2028 private static Field[] infoFields = Debug.MemoryInfo.class.getFields();
2029 private static String dumpFields( Field[] fields, Object obj) {
2030 StringBuilder buf = new StringBuilder();
2031 try {
2032 for ( Field f : fields ) {
2033 if ( buf.length()>0 )
2034 buf.append(", ");
2035 buf.append(f.getName());
2036 buf.append("=");
2037 buf.append(f.get(obj));
2038 }
2039 } catch ( Exception e ) {
2040
2041 }
2042 return buf.toString();
2043 }
2044 public static void dumpHeapAllocation() {
2045 Debug.getMemoryInfo(info);
2046 log.d("nativeHeapAlloc=" + Debug.getNativeHeapAllocatedSize() + ", nativeHeapSize=" + Debug.getNativeHeapSize() + ", info: " + dumpFields(infoFields, info));

Callers 1

dumpHeapAllocationMethod · 0.95

Calls 5

lengthMethod · 0.45
appendMethod · 0.45
getNameMethod · 0.45
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected