Added a new branch that implements support for outputting all memory leaks to

the debug output for the Debug and FastDebug project configurations. This
requires replacing all instances of new with a macro, smnew, that defines a
special form of new which outputs file and line number information along with
the memory leak details. This makes finding memory leaks much easier since you
can just double-click the leak in the output window and it will take you to the
line that caused it.
This commit is contained in:
Shenjoku
2013-04-17 20:42:29 -07:00
parent 05cf6d8cd8
commit 5f7001ef0a
199 changed files with 613 additions and 600 deletions
+10 -10
View File
@@ -150,13 +150,13 @@ public:
AlignedBuffer( int iSize )
{
m_iSize = iSize;
m_pBuf = new T[m_iSize];
m_pBuf = smnew T[m_iSize];
}
AlignedBuffer( const AlignedBuffer &cpy )
{
m_iSize = cpy.m_iSize;
m_pBuf = new T[m_iSize];
m_pBuf = smnew T[m_iSize];
memcpy( m_pBuf, cpy.m_pBuf, sizeof(T)*m_iSize );
}
~AlignedBuffer()
@@ -418,13 +418,13 @@ namespace PolyphaseFilterCache
return pPolyphase;
}
int iWinSize = L*iUpFactor;
float *pFIR = new float[iWinSize];
float *pFIR = smnew float[iWinSize];
GenerateSincLowPassFilter( pFIR, iWinSize, fCutoffFrequency );
ApplyKaiserWindow( pFIR, iWinSize, 8 );
NormalizeVector( pFIR, iWinSize );
MultiplyVector( &pFIR[0], &pFIR[iWinSize], (float) iUpFactor );
PolyphaseFilter *pPolyphase = new PolyphaseFilter( iUpFactor );
PolyphaseFilter *pPolyphase = smnew PolyphaseFilter( iUpFactor );
pPolyphase->Generate( pFIR );
delete [] pFIR;
@@ -478,7 +478,7 @@ public:
SetDownFactor( iUpFactor );
m_pState = new PolyphaseFilter::State( iUpFactor );
m_pState = smnew PolyphaseFilter::State( iUpFactor );
}
~RageSoundResampler_Polyphase()
@@ -500,7 +500,7 @@ public:
void Reset()
{
delete m_pState;
m_pState = new PolyphaseFilter::State( m_iUpFactor );
m_pState = smnew PolyphaseFilter::State( m_iUpFactor );
}
int NumInputsForOutputSamples( int iOut ) const { return m_pPolyphase->NumInputsForOutputSamples(*m_pState, iOut, m_iDownFactor); }
@@ -510,7 +510,7 @@ public:
RageSoundResampler_Polyphase( const RageSoundResampler_Polyphase &cpy )
{
m_pPolyphase = cpy.m_pPolyphase; // don't copy
m_pState = new PolyphaseFilter::State(*cpy.m_pState);
m_pState = smnew PolyphaseFilter::State(*cpy.m_pState);
m_iUpFactor = cpy.m_iUpFactor;
m_iDownFactor = cpy.m_iDownFactor;
}
@@ -625,7 +625,7 @@ void RageSoundReader_Resample_Good::ReopenResampler()
if( m_fRate != -1 )
iMaxDownFactor *= 5;
RageSoundResampler_Polyphase *p = new RageSoundResampler_Polyphase( iUpFactor, iMinDownFactor, iMaxDownFactor );
RageSoundResampler_Polyphase *p = smnew RageSoundResampler_Polyphase( iUpFactor, iMinDownFactor, iMaxDownFactor );
m_apResamplers.push_back( p );
}
@@ -728,14 +728,14 @@ RageSoundReader_Resample_Good::RageSoundReader_Resample_Good( const RageSoundRea
RageSoundReader_Filter(cpy)
{
for( size_t i = 0; i < cpy.m_apResamplers.size(); ++i )
this->m_apResamplers.push_back( new RageSoundResampler_Polyphase(*cpy.m_apResamplers[i]) );
this->m_apResamplers.push_back( smnew RageSoundResampler_Polyphase(*cpy.m_apResamplers[i]) );
this->m_iSampleRate = cpy.m_iSampleRate;
this->m_fRate = cpy.m_fRate;
}
RageSoundReader_Resample_Good *RageSoundReader_Resample_Good::Copy() const
{
return new RageSoundReader_Resample_Good( *this );
return smnew RageSoundReader_Resample_Good( *this );
}
/*