--- a/analyzetool/commandlineengine/src/catallocs.cpp Wed Sep 15 13:53:27 2010 +0300
+++ b/analyzetool/commandlineengine/src/catallocs.cpp Wed Oct 13 16:17:58 2010 +0300
@@ -36,65 +36,14 @@
}
}
-void CATAllocs::AllocH( const string& sAllocHString, const string& aTimeString )
+void CATAllocs::AllocH( const string& sAllocHString )
{
LOG_LOW_FUNC_ENTRY("CATAllocs::AllocH");
string sAllocH( sAllocHString );
// Parse alloc & create new allocation.
CATAlloc alloc;
- alloc.m_sTime = aTimeString;
string sAddress = GetStringUntilNextSpace( sAllocH, true );
- alloc.m_sSize = GetStringUntilNextSpace( sAllocH, true );
- alloc.m_iThreadId = GetStringUntilNextSpace ( sAllocH, true );
- alloc.m_iCSCount = _httoi( string( GetStringUntilNextSpace( sAllocH, true ) ).c_str() );
- // Insert call stack fragment as "first" 1 because we are header.
- if ( alloc.m_iCSCount > 0 )
- alloc.m_vCallStack.insert( pair<unsigned long,string>( 0, sAllocH ) );
- // Add allocation
- pair< map<string,CATAlloc>::iterator, bool> ret;
- ret = m_vAllocs.insert( pair<string, CATAlloc>( sAddress, alloc ) );
- if( ret.second == false )
- {
- // Allocation to this memory address was already added.
- LOG_STRING( "CATAllocs: Allocating same address again, address: " << sAddress );
- }
-}
-
-void CATAllocs::AllocF( const string& sAllocFString, const string& aTimeString )
-{
- LOG_LOW_FUNC_ENTRY("CATAllocs::AllocF");
- string sAllocF( sAllocFString );
- string sAddress = GetStringUntilNextSpace( sAllocF, true );
- string sTime = aTimeString;
- unsigned long iNumber = _httoi( string( GetStringUntilNextSpace( sAllocF, true ) ).c_str() );
- string sCallSstack = sAllocF;
- // Find correct allocation into which add call stack fragment.
- map<string, CATAlloc>::iterator it;
- it = m_vAllocs.find( sAddress );
- // TODO: If cannot find, create new in cache.
- if ( it == m_vAllocs.end() )
- {
- LOG_STRING( "CATAllocs: Allocate fragment without header: " << sAddress );
- return;
- }
- pair< map<unsigned long,string>::iterator, bool> ret;
- // Add call stack to it.
- ret = it->second.m_vCallStack.insert( pair<unsigned long,string>( iNumber, sCallSstack ) );
- if( ret.second == false )
- {
- LOG_STRING( "CATAllocs: Same allocation fragment again: " << sAddress );
- }
-}
-
-// ReallocH.
-void CATAllocs::ReallocH( const string& sReallocHString, const string& aTimeString )
-{
- LOG_LOW_FUNC_ENTRY("CATAllocs::ReallocH");
- string sAllocH( sReallocHString );
- // Parse alloc & create new allocation.
- CATAlloc alloc;
- string sAddress = GetStringUntilNextSpace( sAllocH, true );
- alloc.m_sTime = aTimeString;
+ alloc.m_sTime = GetStringUntilNextSpace( sAllocH, true );
alloc.m_sSize = GetStringUntilNextSpace( sAllocH, true );
alloc.m_iCSCount = _httoi( string( GetStringUntilNextSpace( sAllocH, true ) ).c_str() );
// Insert call stack fragment as "first" 1 because we are header.
@@ -110,13 +59,12 @@
}
}
-// ReallocF.
-void CATAllocs::ReallocF( const string& sReallocFString, const string& aTimeString )
+void CATAllocs::AllocF( const string& sAllocFString )
{
- LOG_LOW_FUNC_ENTRY("CATAllocs::ReallocF");
- string sAllocF( sReallocFString );
+ LOG_LOW_FUNC_ENTRY("CATAllocs::AllocF");
+ string sAllocF( sAllocFString );
string sAddress = GetStringUntilNextSpace( sAllocF, true );
- string sTime = aTimeString;
+ string sTime = GetStringUntilNextSpace( sAllocF, true );
unsigned long iNumber = _httoi( string( GetStringUntilNextSpace( sAllocF, true ) ).c_str() );
string sCallSstack = sAllocF;
// Find correct allocation into which add call stack fragment.
@@ -156,7 +104,7 @@
}
// FreeH.
-void CATAllocs::FreeH( const string& sFreeH, const string& aTimeString )
+void CATAllocs::FreeH( const string& sFreeH )
{
LOG_LOW_FUNC_ENTRY("CATAllocs::FreeH");
// Current implementation does not use call stack of
@@ -164,7 +112,6 @@
string sFree( sFreeH );
string sKey = GetStringUntilNextSpace( sFree );
// Time stamp. (not used currently)
- // Thread ID. (not used currently)
// Call stack count. (not used currently)
// Call stack data. (not used currently)
@@ -181,7 +128,7 @@
}
// FreeF.
-void CATAllocs::FreeF( const string& /* sFreeF */, const string& /* aTimeString */ )
+void CATAllocs::FreeF( const string& /* sFreeF */ )
{
LOG_LOW_FUNC_ENTRY("CATAllocs::FreeF");
// Fragments are currently ignored.