openfoam/applications/test/alloc/Test-new.C
Mark Olesen 499d48cfdb STYLE: uniform 'Test-' prefix for all applications/test
- easier to clean, avoid confusion with 'real' applications, etc.
2010-11-23 16:26:04 +01:00

31 lines
441 B
C

#include <stream.h>
main()
{
int* intPtrs[500000];
cerr << "allocating ints\n";
for (int i=0; i<500000; i++)
{
intPtrs[i] = new int[1];
}
cerr << "allocated ints\n";
cerr << "deallocating ints\n";
for (i=0; i<500000; i++)
{
delete[] intPtrs[i];
}
cerr << "deallocated ints\n";
cerr << "alloacting doubles\n";
double* doubles = new double[500000];
for (;;);
}