Zero memory to duplicate behavior changed when C malloc() was replaced by C++ new().

This commit is contained in:
Wayne Stambaugh 2011-12-06 09:46:48 -05:00
parent e8c3ca2929
commit 68d752bb13
1 changed files with 3 additions and 0 deletions

View File

@ -115,18 +115,21 @@ int MATRIX_ROUTING_HEAD::InitBoard()
/* allocate Board & initialize everything to empty */
m_BoardSide[kk] = (MATRIX_CELL*) operator new( ii * sizeof(MATRIX_CELL) );
memset( m_BoardSide[kk], 0, ii * sizeof(MATRIX_CELL) );
if( m_BoardSide[kk] == NULL )
return -1;
/***** allocate Distances *****/
m_DistSide[kk] = (DIST_CELL*) operator new( ii * sizeof(DIST_CELL) );
memset( m_DistSide[kk], 0, ii * sizeof(DIST_CELL) );
if( m_DistSide[kk] == NULL )
return -1;
/***** allocate Dir (chars) *****/
m_DirSide[kk] = (char*) operator new( ii );
memset( m_DirSide[kk], 0, ii );
if( m_DirSide[kk] == NULL )
return -1;