Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <malloc.h>
- #include <stdio.h>
- #include <unistd.h>
- #define SIZE (20*1024l*1024*1024)
- int main(int argc, char ** argv) {
- char *m = malloc(SIZE);
- long i;
- for (i=0; i<SIZE; i++) {
- m[i]=1;
- }
- printf("Allocated and used %ld bytes, sleeping a bit\n", SIZE);
- sleep(5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement