Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int *memory_area1 = malloc(819200000);
- int *p;
- int i, k, j = 0;
- printf("starting after 90 seconds\n");
- sleep(90);
- for (i = 0; i < 195; i++) {
- printf("i = %d\n", i);
- /* read 512 4kB pages */
- for (k = 0; k < 512; k++) {
- *p = memory_area1[j];
- j += 1024;
- }
- /* write 512 4kB pages */
- for (k = 0; k < 512; k++) {
- memory_area1[j] = 1;
- j += 1024;
- }
- }
- printf("first 800MB allocated\n");
- printf("read-write is completed\n");
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment