We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ca3f14 commit ae70951Copy full SHA for ae70951
balloon.c
@@ -16,15 +16,17 @@ int main(int argc, char **argv) {
16
int size = atoi(argv[1]);
17
printf("megabytes: %d\n", size);
18
19
- for (int x = 0; x < size; x++) {
+ int x;
20
+ for (x = 0; x < size; x++) {
21
// We're going to leak this.
22
uint64_t *temp = calloc(1, 1024 * 1024);
23
if (temp == NULL) {
24
fprintf(stderr, "Failed to calloc chunk #%d\n", x);
25
exit(1);
26
}
27
+ int i;
28
// Fill a bit harder to ensure RAM gets allocated
- for (int i = 0; i < (1024*1024) / sizeof(uint64_t); i++) {
29
+ for (i = 0; i < (1024*1024) / sizeof(uint64_t); i++) {
30
temp[i] = i;
31
32
0 commit comments