memspy/Engine/Source/Helpers/MemSpyEngineHelperHeap.cpp
changeset 26 4fde310f06fe
parent 0 a03f92240627
child 30 86a2e675b80a
equal deleted inserted replaced
21:f5d4820de50d 26:4fde310f06fe
   897     //
   897     //
   898     return list;
   898     return list;
   899     }
   899     }
   900 
   900 
   901 
   901 
       
   902 //cigasto: not formatted - raw heap info 
       
   903 EXPORT_C TMemSpyHeapData CMemSpyEngineHelperHeap::NewHeapRawInfo( const TMemSpyHeapInfo& aInfo )
       
   904 	{
       
   905 	TMemSpyHeapData list;
       
   906 
       
   907 	// Heap type	
       
   908 	if ( aInfo.Type() == TMemSpyHeapInfo::ETypeUnknown )
       
   909 		{
       
   910 		_LIT( KItem0_Type_Unknown, "Unknown" );
       
   911 		list.iType.Append( KItem0_Type_Unknown );
       
   912 		}
       
   913 	else if ( aInfo.Type() == TMemSpyHeapInfo::ETypeRHeap )
       
   914 		{
       
   915 		const TMemSpyHeapInfoRHeap& rHeap = aInfo.AsRHeap();
       
   916 		const TMemSpyHeapMetaDataRHeap& metaData = rHeap.MetaData();
       
   917 		const TMemSpyHeapObjectDataRHeap& objectData = rHeap.ObjectData();
       
   918 		const TMemSpyHeapStatisticsRHeap& statistics = rHeap.Statistics();
       
   919 
       
   920 		_LIT( KItem0_Type_RHeap, "RHeap" );
       
   921 		list.iType.Append( KItem0_Type_RHeap );
       
   922 
       
   923 	    // Heap size is the size of the heap minus the size of the embedded (in-place) RHeap. 	    
       
   924 	    list.iSize = objectData.Size();
       
   925 	    list.iBaseAddress = (TUint) objectData.Base();	        
       
   926 	    list.iShared = metaData.IsSharedHeap();
       
   927 	    list.iChunkSize = metaData.ChunkSize();
       
   928 	    list.iAllocationsCount = statistics.StatsAllocated().TypeCount();
       
   929 	    list.iFreeCount = statistics.StatsFree().TypeCount();
       
   930 	    list.iBiggestAllocation = statistics.StatsAllocated().LargestCellSize();
       
   931 	    list.iBiggestFree = statistics.StatsFree().LargestCellSize();
       
   932 	    list.iTotalAllocations =  statistics.StatsAllocated().TypeSize();	        
       
   933 	    list.iTotalFree =  statistics.StatsFree().TypeSize();
       
   934 	    list.iSlackFreeSpace = statistics.StatsFree().SlackSpaceCellSize();
       
   935 	    list.iFragmentation = statistics.StatsFree().TypeSize() - statistics.StatsFree().SlackSpaceCellSize(); //to calculate percentage value use iSize as 100% value
       
   936 	    list.iHeaderSizeA = metaData.HeaderSizeAllocated();
       
   937 	    list.iHeaderSizeF = metaData.HeaderSizeFree();
       
   938 	    TInt allocOverhead = metaData.HeaderSizeAllocated() * statistics.StatsAllocated().TypeCount();
       
   939 	    list.iAllocationOverhead = allocOverhead;
       
   940 	    TInt freeOverhead = metaData.HeaderSizeFree() * statistics.StatsFree().TypeCount();
       
   941 	    list.iFreeOverhead = freeOverhead;
       
   942 	    list.iTotalOverhead = freeOverhead + allocOverhead;
       
   943 	    list.iOverhead = freeOverhead + allocOverhead; //to calculate percentage value use iSize as 100% value    
       
   944 	    list.iMinLength = objectData.iMinLength;
       
   945 	    list.iMaxLength = objectData.iMaxLength;
       
   946 	    list.iDebugAllocatorLibrary = metaData.IsDebugAllocator();
       
   947 		}
       
   948 
       
   949 	return list;
       
   950 	}
   902 
   951 
   903 
   952 
   904 
   953 
   905 
   954 
   906 
   955