reaper: fix spacing

This commit is contained in:
Christine Dodrill 2015-06-12 12:53:18 -07:00
parent 3560ec838c
commit bb763eb5e1
1 changed files with 18 additions and 14 deletions

View File

@ -7,20 +7,24 @@
void * mem[16]; void * mem[16];
int main() { int main() {
int i; int i;
for(i=0; i < 16; i++) { for(i=0; i < 16; i++) {
mem[i] = malloc(AMOUNT); // One gigabyte XXX do not do this mem[i] = malloc(AMOUNT); // One gigabyte XXX do not do this
memset(mem[i], 0, AMOUNT); memset(mem[i], 0, AMOUNT);
printf("Allocated %d GB of ram...\n", i+1); printf("Allocated %d GB of ram...\n", i+1);
} }
printf("16 GB of memory used, waiting for input... "); printf("16 GB of memory used, waiting for input... ");
while(1) { while(1) {
printf("Trashing ram use...\n"); printf("Trashing ram use...\n");
for(i=0; i < 16; i++) { for(i=0; i < 16; i++) {
memcpy(mem[i], mem[(i+1)%16], AMOUNT); memcpy(mem[i], mem[(i+1)%16], AMOUNT);
} }
} }
}
for (i=0; i < 16; i++) {
free(mem[i]);
}
}