Download data/applications/test/alloc/Test-new.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 441 Bytes
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/test/alloc/Test-new.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/applications/test/alloc/Test-new.C
-
curl -L -o Test-new.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/test/alloc/Test-new.C
441 Bytes
| 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 << "allocating doubles\n"; | |
| double* doubles = new double[500000]; | |
| for (;;); | |
| } | |