1 package shark 2 3 /** 4 * A primitive type in the prof. 5 */ 6 enum class PrimitiveType( 7 /** 8 * The hprof defined "basic type". 9 */ 10 val hprofType: Int, 11 /** 12 * The size in bytes for each value of that type. 13 */ 14 val byteSize: Int 15 ) { 16 BOOLEAN(4, 1), 17 CHAR(5, 2), 18 FLOAT(6, 4), 19 DOUBLE(7, 8), 20 BYTE(8, 1), 21 SHORT(9, 2), 22 INT(10, 4), 23 LONG(11, 8); 24 25 companion object { 26 /** 27 * The hprof defined "basic type" for references. 28 */ 29 const val REFERENCE_HPROF_TYPE = 2 30 <lambda>null31 val byteSizeByHprofType = values().associate { it.hprofType to it.byteSize } 32 <lambda>null33 val primitiveTypeByHprofType = values().associateBy { it.hprofType } 34 } 35 } 36