我这的情况是linux跑没问题移植到windows上出现该问题,vs没有任何代码断点提示,通过一点点打印抓出来是因为linux的获取内存函数导致,屏蔽掉即可:
size_t check_mem()
{
FILE* file = fopen("/proc/self/status", "r");
int result = -1;
char line[128];
while(fgets(line, 128, file) != nullptr)
{
if(strncmp(line, "VmRSS:", 6) == 0)
{
int len = strlen(line);
const char* p = line;
for(; std::isdigit(*p) == false; ++p){}
line[len - 3] = 0;
result = atoi(p);
break;
}
}
fclose(file);
return result;
}