3 Test program to sort a large number of integers.
5 Intention is to stress virtual memory system.
7 Ideally, we could read the unsorted array off of the file
8 system, and store the result back to the file system! */
11 /* Size of array to sort. */
17 /* Array to sort. Static to reduce stack usage. */
18 static int array
[SORT_SIZE
];
22 /* First initialize the array in descending order. */
23 for (i
= 0; i
< SORT_SIZE
; i
++)
24 array
[i
] = SORT_SIZE
- i
- 1;
26 /* Then sort in ascending order. */
27 for (i
= 0; i
< SORT_SIZE
- 1; i
++)
28 for (j
= 0; j
< SORT_SIZE
- 1 - i
; j
++)
29 if (array
[j
] > array
[j
+ 1])
32 array
[j
] = array
[j
+ 1];
36 printf ("sort exiting with code %d\n", array
[0]);