Created
January 15, 2014 20:13
-
-
Save cooperq/8443635 to your computer and use it in GitHub Desktop.
malloc malloc malloc
malloc all day long
malloc malloc malloc
this is the malloc song!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
void main(){ | |
printf("Allocating all the memory...\n"); | |
while(1){ | |
int *buffer = malloc(1024); | |
if(buffer == NULL){ | |
printf("could not allocate any more memory\n"); | |
} | |
} | |
printf("quitting...\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment