mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: uniform 'Test-' prefix for all applications/test
- easier to clean, avoid confusion with 'real' applications, etc.
This commit is contained in:
30
applications/test/alloc/Test-malloc.C
Normal file
30
applications/test/alloc/Test-malloc.C
Normal file
@ -0,0 +1,30 @@
|
||||
#include "stream.h"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
main()
|
||||
{
|
||||
int *ptrs[500000];
|
||||
|
||||
cerr << "allocating ints\n";
|
||||
|
||||
for (int i=0; i<500000; i++)
|
||||
{
|
||||
ptrs[i] = (int*)malloc(sizeof(int));
|
||||
}
|
||||
|
||||
// for (;;);
|
||||
|
||||
cerr << "deallocating ints\n";
|
||||
|
||||
for (i=0; i<500000; i++)
|
||||
{
|
||||
free(ptrs[i]);
|
||||
}
|
||||
|
||||
cerr << "allocating double\n";
|
||||
|
||||
double* array = (double*)malloc(500000*sizeof(double));
|
||||
|
||||
for (;;);
|
||||
}
|
||||
Reference in New Issue
Block a user