Компилятор VS2012 Странные проблемы освобождения памяти
у меня странная проблема с компилятором VS2012, который неКажется, что они появляются в GCC. Процесс освобождения занимает минуты, а не секунды. У кого-нибудь есть какие-либо материалы по этому вопросу? Пошаговая отладка показывает заметное зависание при вызовах RtlpCollectFreeBlocks (). У меня есть эта проблема как в режиме отладки, так и в режиме выпуска. Я'м под управлением Windows 7 32-разрядная, но у меня та же проблема на 64-разрядной версии 7.
#include "stdafx.h"
#include
#include
#include
#define SIZE 500000
using namespace std;
typedef struct
{
uint32_t* thing1;
}collection;
/*
* VS2012 compiler used.
* Scenarios:
* 1) Don't allocate thing1. Program runs poorly.
* 2) Allocate thing1 but don't delete it. Program runs awesome.
* 3) Allocate thing1 and delete it. Program runs poorly.
*
* Debug or Release mode does not affect outcome. GCC's compiler is fine.
*/
int _tmain(int argc, _TCHAR* argv[])
{
collection ** colArray = new collection*[SIZE];
for(int i=0;ithing1 = new uint32_t; // Allocating without freeing runs fine. Either A) don't allocate or B) allocate and delete to make it run slow.
colArray[i] = mine;
}
cout