Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define S (1<<27)
- int main(int argc, char* argv[])
- {
- void *a, *b;
- a = malloc(S);
- b = malloc(S);
- if (a == 0 || b == 0) {
- puts("malloc failed\n");
- return EXIT_FAILURE;
- }
- puts("malloced\n");
- while (1) {
- memcpy(b,a, S);
- puts("a->b\n");
- memcpy(a,b, S);
- puts("b->a\n");
- }
- }
Add Comment
Please, Sign In to add comment