iKa*_*lan 1 c c++ optimization release visual-studio-2010
我正在研究VS 2010 express并尝试进行一些文件读取和解析工作
我的功能是这样的......(我丢掉了无聊的部分)
void SomeClass::SomeFunc(char *ALName, std::map<...> *chromList, std::map<...> *chromLine)
{
ifstream file;
char tmpBuff[500];
char tmpBuff2[500];
char fileName[350];
char tmp[350];
char *pch;
char *pch2;
.....
file.open(fileName);
while ( file.getline( tmpBuff, 500 ) )
{
....
if ( some_condition == 0 )
{
pch2 = strtok( NULL, "," );
pch = strtok( NULL, "," );
(*chromList)[pch2] = do_some_work( atoi(pch), tmpBuff2 );
strcpy( tmp, get_chrom_line( tmpBuff2 ) );
(*chromLine)[pch2] = tmp;
}
}
file.close();
}
Run Code Online (Sandbox Code Playgroud)
当我更改为Release with Optimization设置为Maximum speed时,将跳过此功能.调试器进入该函数并立即返回.
当我运行Debug设置或Release并将Optimization标志设置为disabled时,该函数运行正常.
可能的原因是什么?我是否可以使用预处理器定义强制对此函数执行"无优化",同时优化其余代码
谢谢!!伊詹
归档时间: |
|
查看次数: |
216 次 |
最近记录: |